Skip to content

Instantly share code, notes, and snippets.

View terrafied's full-sized avatar
💭
Shopping for cute shoes

Terra Metta terrafied

💭
Shopping for cute shoes
  • The Trans Agenda
  • 62 West Wallaby St., The Shire
View GitHub Profile
module Randomizer
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
def some(num = 5)
find :all, :order => 'random()', :offset => (count * rand).to_i, :limit => num
end
Veewee::Session.declare( {
:cpu_count => '1',
:memory_size=> '512',
:disk_size => '10140',
:disk_format => 'VDI',
:disk_size => '10240' ,
:os_type_id => 'Ubuntu',
:iso_file => "ubuntu-10.04.1-server-i386.iso",
:iso_src => "http://releases.ubuntu.com/10.04.1/ubuntu-10.04.1-server-i386.iso",
:iso_md5 => "01f72c846845e4e19aec8a45912e5dda",
@terrafied
terrafied / load.rake
Created November 8, 2011 17:32 — forked from pjb3/load.rake
namespace :load do
ZIP_CODE_DATA_URL = 'http://www.census.gov/tiger/tms/gazetteer/zips.txt'
# Swiped from ActiveRecord migrations.rb
def announce(message)
length = [0, 75 - message.length].max
puts "== %s %s" % [message, "=" * length]
end
@terrafied
terrafied / securing_rails_updates.md
Created March 5, 2012 16:39 — forked from peternixey/securing_rails_updates.md
How Homakov hacked GitHub and how to protect your application

##How Homakov hacked GitHub and the line of code that could have prevented it


Please note: THIS ARTICLE IS NOT WRITTEN BY THE GITHUB TEAM or in any way associated with them. It's simply hosted as a Gist because the markdown formatting is excellent and far clearer than anything I could manage on my personal Tumblr at peternixey.com.

If you'd like to follow me on twitter my handle is @peternixey


#!/bin/bash
# This script is edited by Brice Dutheil
# See there in french http://blog.arkey.fr/2012/07/30/script-pour-installer-le-jdk-5-sur-macosx-lion/
# Translate button is broken for now, please use Google to translate this website.
#
# 2012/08/25 This script didn't behave correctly when ran on 10.8.1
# Added recommendation to always run this script after updates such as Java, XCode, OSX, etc.
#
# 2O12/07/29 Added Mountain Lion support => Choose the 64bit JVM !
@terrafied
terrafied / .gitconfig
Last active May 12, 2016 14:23 — forked from igal/.gitconfig
#---[ Includes ]--------------------------------------------------------
[include]
# Load private information from a separate file, e.g. name, email, global
# ignores, tokens, etc.
path = ~/.gitconfig.local
#---[ Settings ]--------------------------------------------------------
[core]

Installing a Gem on Heroku from a Private GitHub Repo

Sometimes you want to use a gem on Heroku that is in a private repository on GitHub.

Using git over http you can authenticate to GitHub using basic authentication. However, we don't want to embed usernames and passwords in Gemfiles. Instead, we can use authentication tokens.

  1. Get an OAuth Token from GitHub

First you will need to get an OAuth Token from GitHub using your own username and "note"

@terrafied
terrafied / 0_reuse_code.js
Last active August 29, 2015 14:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@terrafied
terrafied / build-gn.sh
Created November 14, 2017 18:35 — forked from mohamed/build-gn.sh
Build Google gn build tool standalone
#!/bin/bash
set -e
set -v
# Get the sources
mkdir gn-standalone
cd gn-standalone
mkdir tools
cd tools
@terrafied
terrafied / build-gn.sh
Created November 14, 2017 18:35 — forked from mohamed/build-gn.sh
Build Google gn build tool standalone
#!/bin/bash
set -e
set -v
# Get the sources
mkdir gn-standalone
cd gn-standalone
mkdir tools
cd tools