Skip to content

Instantly share code, notes, and snippets.

View perplexes's full-sized avatar

Colin Curtin perplexes

View GitHub Profile
@perplexes
perplexes / buildpacks.md
Last active November 25, 2021 02:29
Heroku custom compiled library .bundle/config

Buildpacks

Heroku uses buildpacks to compile your application into a slug that is used across dynos for scaling horizontally quickly. A slug is a tar.gz archive of your app’s repository with certain pre-deploy features baked into the filesystem. Since everything to run your application is included in the archive, scaling becomes a simple matter of transferring it to a dyno, unpacking, and running the appropriate process. This is how Heroku achieves scaling-by-moving-a-slider.

For example, the Ruby buildpack will:

  • install ruby locally
  • install the jvm/jruby (if you’re using it)
  • install/run bundler and install your gems to Rails.root/vendor
  • create your database.yml (which ends up reading from your app’s environment variables)
@perplexes
perplexes / instructions.txt
Created June 6, 2012 20:42
Move messages from iPhone to Android
# Migrate SMS from iPhone to Android in OSX #
Parts of this taken from http://pastebin.com/d4hNUmTK
1. Make an unencrypted backup of your iPhone to iTunes, not using iCloud.
2. cd /tmp
3. put iphone_sms_* here (found below)
4. Find your ~/Library/Application Support/MobileSync/Backup/*/3d0d7e5fb2ce288813306e4d4636395e047a3d28(.mddata)
5.
> sqlite3 ~/Library/Application Support/MobileSync/Backup/(id)/3d0d7e5fb2ce288813306e4d4636395e047a3d28(.mddata)

Keybase proof

I hereby claim:

  • I am perplexes on github.
  • I am perplexes (https://keybase.io/perplexes) on keybase.
  • I have a public key ASBHMwgldVX7we8SdIJIpJFUZRHxqp60XQbMIxHdMfS2JAo

To claim this, I am signing this object:

# Given a weight, break down into buildup to work weight
# 45, 50, 65, 70, 75-80, 90, 100
#
# weight sizes: 2.5, 5, 10, 15, 25, 35, 45
# bar weight: 45
#
# example: final weight 155
#
# 45%: 69.75 - 45 = 24.75 / 2 = 12.375. we can choose 15 (for 75lbs or 48%), or 10 + 2.5 for something close but more weights
# TODO: choose less weights
@perplexes
perplexes / gist:e994b788d61b92124921
Created January 14, 2016 20:16
Get current elasticache servers from elasticache config server
$ echo "config get cluster" | nc -i1 name.sha.cfg.use1.cache.amazonaws.com 11211 | sed '3q;d' | tr ' ' '\n' | awk -F'|' '{print $1":"$3}'
verba.pysff9.0001.use1.cache.amazonaws.com:11211
verba.pysff9.0002.use1.cache.amazonaws.com:11211
@perplexes
perplexes / Chromebits.MD
Last active January 13, 2016 19:19
Chromebits & Librato
@perplexes
perplexes / node.rb
Created June 5, 2013 22:14
Hash/Array Tree searcher
# > n = Node.find_where(terms2){|v| !v["Section"].empty?}
# => #<Node key="Sections" value=Hash children=1>
# > puts n.path
# => [0]["Departments"]["Department"][3]["Courses"]["Course"][1]["Sections"]
class Node
attr_reader :parent, :key, :value, :children
def initialize(parent, key, value)
@parent = parent
@key = key
@value = value
@perplexes
perplexes / gist:5118700
Created March 8, 2013 18:34
Post csv to gist with net/http
require 'csv'
csv_string = CSV.generate do |csv|
csv << titles
data.sample(1000).each do |row|
csv << row
end
end; csv_string.size
require 'net/http'
require 'uri'
@perplexes
perplexes / tumblr2wordpress.rb
Last active December 14, 2015 02:49
A small script for moving from tumblr to wordpress
require 'xmlrpc/client'
wordpress = XMLRPC::Client.new('academiaedu.wordpress.com', '/xmlrpc.php')
require 'tumblr_client'
# To get these:
# Go to http://tumblr-rb.herokuapp.com/ (a service for the below)
# --OR--
# `gem install tumblr-rb` somewhere with a public ip address
@perplexes
perplexes / gradient.scss
Last active December 11, 2015 22:54
Parsing bug linear-gradient
.test{ background-image: -ms-linear-gradient(top left, #4D303B48 0%, #4D2C3642 100%);}