In config/production.rb
config.action_mailer.asset_host = "https://123123.cloudfront.net"
In config/initializers/mail_image_tag.rb
module ActionView
/* | |
Backdoor found in GCHQ Christmas Puzzle | |
======================================= | |
SPOILER ALERT - If you're attempting the puzzle and you don't want to find out | |
any hints do not read ahead!* | |
Yesterday I completed Part 4 of the GCHQ Christmas Puzzle | |
[http://www.gchq.gov.uk/press_and_media/news_and_features/Pages/Director%27s-Christmas-puzzle-2015.aspx]. |
require 'bundler/setup' | |
require 'active_record' | |
include ActiveRecord::Tasks | |
class Seeder | |
def initialize(seed_file) | |
@seed_file = seed_file | |
end |
# h = {}; Event.all.each { |e| h[e.useragent] = (h[e.useragent] || 0) + 1; } | |
# h.keys.each { |k| puts "#{h[k]},#{k}" | |
class UserAgent | |
# gplus => "Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20110814 Firefox/6.0" | |
BOTS = [ | |
{ :name => 'AppEngine', :match => 'AppEngine', :url => 'http://code.google.com/appengine'}, | |
{ :name => 'Embedly', :match => 'Embedly', :url => 'http://support.embed.ly/'}, | |
{ :name => 'news.me', :match => 'news.me', :url => ''}, | |
{ :name => 'Voyager', :match => 'Voyager/1.0', :url => ''}, | |
{ :name => 'bitlybot', :match => 'bitlybot', :url => ''}, |
class OutlookCalendarService | |
APP_ID = your_app_id | |
APP_SECRET = your_app_secret | |
LOGIN_API_DOMAIN = 'https://login.microsoftonline.com' | |
AUTHORIZE_PATH = '/common/oauth2/v2.0/authorize' | |
TOKEN_PATH = '/common/oauth2/v2.0/token' | |
CALENDAR_API_DOMAIN = 'https://outlook.office365.com' | |
VERSION_PATH = '/api/v2.0' |
#!/bin/bash | |
# Use these in your .dotfiles to help make Docker more manageable | |
$(boot2docker shellinit 2> /dev/null) | |
alias dip='boot2docker ip 2> /dev/null' | |
alias dkd="docker run -d -P" | |
alias dki="docker run -t -i -P" | |
db() { docker build -t="$1" .; } |
#!/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# git hook to run a command after `git pull` or `git checkout` if a specified file was changed | |
# Run `chmod +x post-checkout` to make it executable then put it into `.git/hooks/`. | |
changed_files="$(git diff-tree -r --name-only --no-commit-id HEAD@{1} HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && echo " * changes detected in $1" && echo " * running $2" && eval "$2" |
#!/usr/bin/ruby | |
# Example of how to unblock EventMachine's deffered callbacks | |
# Based on http://stackoverflow.com/a/11778588/632827 | |
# For output example see: http://goo.gl/d6E9E0 | |
require 'eventmachine' | |
iam = [ 'blocking', 'non-blocking' ] |
require "json" | |
require "yaml" | |
require "secure_random" | |
class SerializableKlass | |
YAML.mapping({ | |
bool: { type: Bool, nilable: true}, | |
float: { type: Float64, nilable: true}, | |
int: { type: Int32, nilable: true}, | |
str: { type: String, nilable: true} |
In config/production.rb
config.action_mailer.asset_host = "https://123123.cloudfront.net"
In config/initializers/mail_image_tag.rb
module ActionView
Configure local wildcard DNS server
sudo apt-get install dnsmasq
/etc/NetworkManager/NetworkManager.conf
and comment out (#
) the line that reads dns=dnsmasq
. Restart NetworkManager afterwards: sudo restart network-manager
with Unbutu > = 15.04 this becomes sudo systemctl restart network-manager
/etc/dnsmasq.conf
, and adding the line listen-address=127.0.0.1
./etc/dnsmasq.d
(eg. /etc/dnsmasq.d/dev
), and add the line address=/dev/127.0.0.1
to have dnsmasq resolve requests for *.dev domains. Restart Dnsmasq: sudo /etc/init.d/dnsmasq restart
.Restart Update: https://help.ubuntu.com/community/NetworkManager source: http://brunodbo.be/blog/2013/04/setting-up-wildcard-apache-virtual-host-wildcard-dns