This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Cross browser way to split very long words into multiple lines. | |
// From https://justmarkup.com/log/2015/07/31/dealing-with-long-words-in-css/?mc_cid=ce70bb0280&mc_eid=da0b57a173 | |
.hyphenate { | |
overflow-wrap: break-word; | |
word-wrap: break-word; | |
-webkit-hyphens: auto; | |
-ms-hyphens: auto; | |
-moz-hyphens: auto; | |
hyphens: auto; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example nginx + git HTTP Smart mode (git-http-backend) + HTTP Authentication + HTTPS redirect | |
# [email protected] - http://jeroen.massar.ch | |
server { | |
listen 192.0.1.1:80; | |
listen [2001:db8::1]:80; | |
# Redirect all non-HTTPS traffic to the HTTPS variant | |
return 301 https://$host$request_uri; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copy of Paranoia gem without default_scope, which cannot be removed for assotiations | |
# in Rails 3.0. Refactored to use ActiveSupport::Concern, as it's only one file and don't need | |
# separate vendor/plugin. | |
module Paranoia | |
extend ::ActiveSupport::Concern | |
included do | |
scope :deleted, ->{ where.not(deleted_at: nil) } | |
scope :visible, ->{ where(deleted_at: nil) } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Type" : "SubscriptionConfirmation", | |
"MessageId" : "0941b7b3-4797-44e5-8079-dbf8ef09793f", | |
"Token" : "2336412f37fb687f5d51e6e241d164b0533302ec696efc8f113cd2252ce8a925c1e44a3c4ca2984675da85b9bd8c05da85337beb1f24a9c659b22ed3a8cc682f3457c4ead28d392a40e5c35c0e9> | |
"TopicArn" : "arn:aws:sns:us-west-2:164053224164:email-list", | |
"Message" : "You have chosen to subscribe to the topic arn:aws:sns:us-west-2:164053224164:email-list.\nTo confirm the subscription, visit the SubscribeURL included in this message", | |
"SubscribeURL" : "https://sns.us-west-2.amazonaws.com/?Action=ConfirmSubscription&TopicArn=arn:aws:sns:us-west-2:164053224164:email-list&Token=REDACTED", | |
"Timestamp" : "2013-10-05T17:00:04.135Z", | |
"SignatureVersion" : "1", | |
"Signature" : "<REDACTED>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fileutils' | |
require 'logger' | |
require 'erb' | |
# Pdf generation service based on wkhtmltopdf. | |
class PdfGenerator | |
class WkhtmltopdfError < RuntimeError; end | |
DPI = 96 # Pixels in inch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
require 'oauth2' | |
require 'json' | |
require 'logger' | |
require 'pp' | |
set :port, 3000 | |
site = ARGV[0] || 'http://paszport.epf.org.pl/' | |
callback_host = ARGV[1] || 'http://localhost:3000' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Helpful reference http://alexpeattie.com/blog/working-with-dates-in-git/ | |
require 'date' | |
require 'pp' | |
cmd="git log --author='#{ARGV[0]}' --abbrev-commit --format=medium --date=iso" | |
cmd+= " --since=#{Date.parse(ARGV[1]).to_s}" if ARGV[1] | |
cmd+= " --until=#{Date.parse(ARGV[2]).to_s}" if ARGV[2] | |
e = e = <<GIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module MyModule | |
# Regenerating code | |
end unless __FILE__ == $0 | |
if __FILE__ == $0 | |
require 'savon' | |
split_on = "#" + " Regenerating code" | |
code = File.read(__FILE__).split(split_on).last | |
wsdl_file_path = File.join(File.dirname(__FILE__), ARGV.first || raise("Gimme file!")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open-uri' | |
require 'json' | |
require 'ostruct' | |
require 'mail' # you need to `gem install mail` | |
# Retrieval | |
print "Connecting to api.ihackernews.com ... "; $stdout.flush | |
home_page = open('http://api.ihackernews.com/page').read | |
puts "done." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aptitude install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison git pwgen vim libcurl4-openssl-dev | |
chmod 777 /opt | |
adduser www | |
su www | |
cd ~ | |
curl -L get.rvm.io | bash -s stable |
NewerOlder