Skip to content

Instantly share code, notes, and snippets.

View jpinnix's full-sized avatar

Jeremy Pinnix jpinnix

View GitHub Profile
task :setup_known_hosts do
run "echo 'github.com,65.74.180.52 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==' > ~/.ssh/known_hosts"
end
before "deploy:update_code", "setup_known_hosts"
@jpinnix
jpinnix / gist:400152
Created May 13, 2010 18:07
jQuery - Make all external links open in new tab/window
// JQuery - Make all external links open in new tab/window
// Mashup of:
// http://travisroberts.tumblr.com/post/595428703/jquery-external-links-open-new-window
// http://snipplr.com/view.php?codeview&id=29949
$(document).ready(function() {
$("a[href*='http://']:not([href*='"+location.hostname+"'])").click( function() {
window.open( $(this).attr('href') );
return false;
});
@geoffalday
geoffalday / gist:5105602
Last active December 14, 2015 15:08
Car Monitor + Raspberry Pi settings
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
overscan_left=22
overscan_right=38
overscan_top=-22
overscan_bottom=-24
@tursunovic
tursunovic / Flat.dvtcolortheme
Last active December 17, 2015 00:29
Flat UI inspired theme for Xcode. Ported from http://toychesttheme.com.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0.212201 0.768277 0.395397 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>SourceCodePro-Medium - 14.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>0.212201 0.768277 0.395397 1</string>
@dixia
dixia / dump device tokens from Urbanairship
Created June 28, 2013 12:16
Dumping device tokens from Urbanairship. Pry is used.
require 'rubygems'
require 'httparty'
require 'pry'
results = []
def get_device_tokens url
if url.nil?
url = "https://go.urbanairship.com/api/device_tokens/"
end
options = {:basic_auth => {:username => 'x', :password => 'x'}}
@jeremy
jeremy / schema.xml
Created April 2, 2011 00:53
Basecamp Solr schema
<?xml version="1.0" encoding="UTF-8" ?>
<schema name="basecamp" version="1.3">
<types>
<!-- indexed/stored verbatim -->
<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true" omitTermFreqAndPositions="true"/>
<!-- "true" or "false" -->
<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true" omitTermFreqAndPositions="true"/>
<!-- binary data, base64 -->
@aoswalt
aoswalt / soap_method.ex
Last active June 20, 2018 15:33
soap method macro for building request body and handling soap responses
defmodule MdToolbox.Api.SoapMethod do
alias __MODULE__
alias MdToolbox.Api.Request
@doc "Builds the request from params"
@callback build_request(params :: list()) :: map()
@doc "Parses the request's response into data"
@callback parse_response(request :: Request.t()) :: Request.t()
@andersonmcook
andersonmcook / constants.exs
Last active June 20, 2018 15:33
Naïve approaches to cross-module constants not using config
# use Mix.Config
# config :constants,
# :some_string: "some_string",
# :range_i_like: 1..5,
# :a_map: %{letters: ~w(a b c)}
defmodule Constants.Macro do
# Take code and convert to AST
# Inject name into quoted expression as the name of the macro
@minhajuddin
minhajuddin / config_compiler.exs
Last active August 23, 2018 13:47
Compiled configuration
# This is the target module which will be overwritten after dynamic compilation
# You'll be using this to read configuration in your code. For instance, if you
# have a configuration key called `:redis_timeout`, you could read it using
# `MM.Config.get(:redis_timeout)`
defmodule MM.Config do
# we use a default implementation which raises an error when our code tries
# to read configuration before it is compiled.
def get(_key), do: raise("Config has not been compiled yet!")
end
@marcuswestin
marcuswestin / aws-ssl-termination-digicert.md
Last active August 28, 2018 15:18
How to set up an AWS SSL terminating Elastic Load Balancer with a Digicert certificate

1: Generate CSR

openssl req -new -newkey rsa:2048 -nodes -keyout server-cert.key -out server-cert-sign-req.csr

# Country Name (2 letter code) [AU]:US
# State or Province Name (full name) [Some-State]:California
# Locality Name (eg, city) []:
# Organization Name (eg, company) [Internet Widgits Pty Ltd]:Flutterby Labs, Inc.
# Organizational Unit Name (eg, section) []:
# Common Name (eg, YOUR name) []:www.dogo.co