This file contains 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
source 'http://ruby.taobao.org' | |
gem 'sinatra' | |
gem 'sinatra-reloader' | |
gem 'slim' | |
gem 'sass' | |
gem 'coffee-script' | |
gem 'compass' | |
gem 'pry' |
This file contains 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
# Joyent SmartOS Base64 1.8.1 | |
# shove this in ~/.chef/bootstrap/joyent-smartos.erb | |
# run knife bootstrap <hostname> -d joyent-smartos | |
bash -c ' | |
if [ ! -f /opt/local/bin/chef-client ]; then | |
pkgin -f update | |
pkgin -y install gcc47 gcc47-runtime scmgit-base scmgit-docs gmake ruby193-base ruby193-yajl ruby193-nokogiri ruby193-readline emacs-nox11 pkg-config | |
gem update --system | |
gem install --no-ri --no-rdoc ohai |
This file contains 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
# notify.rb | |
require 'sinatra/base' | |
require 'sinatra/json' | |
require 'grocer' | |
class App | |
attr_accessor :bundleID, :pusher_dev, :pusher_prod | |
end | |
This file contains 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
#!/bin/bash | |
sudo kextunload -b org.virtualbox.kext.VBoxUSB | |
sudo kextunload -b org.virtualbox.kext.VBoxNetFlt | |
sudo kextunload -b org.virtualbox.kext.VBoxNetAdp | |
sudo kextunload -b org.virtualbox.kext.VBoxDrv | |
sudo kextload /Library/Extensions/VBoxDrv.kext -r /Library/Extensions/ | |
sudo kextload /Library/Extensions/VBoxNetFlt.kext -r /Library/Extensions/ | |
sudo kextload /Library/Extensions/VBoxNetAdp.kext -r /Library/Extensions/ |
This file contains 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
# See https://groups.google.com/forum/#!topic/rubyonrails-core/Lb9rBkZnZSo | |
module TrackHabtmChanges | |
def self.included(model) | |
model.after_initialize :track_habtm_initial_state | |
model.after_save :track_habtm_initial_state | |
end | |
def changes | |
super.merge(habtm_changes) | |
end |
This file contains 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
def Process.gsub pat, sub | |
mem = File.open('/proc/self/mem', 'r+') | |
maps = File.open('/proc/self/maps') | |
maps.each do |map| | |
from, to, perms, offset = map.scan(/(\h+)-(\h+) (\S+) (\h+)/)[0] | |
if perms['rw'] | |
from, to = [from, to].map { |addr| addr.hex + offset.hex } | |
data = mem.tap { |m| m.seek from }.read(to - from) rescue next |
This file contains 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
/* demo app that uses the inline directive */ | |
var myApp = angular.module('inlineDemo', ['inline']); | |
myApp.config(function ($routeProvider) {}); | |
myApp.controller('names', function ($scope) { | |
console.log('controller'); | |
$scope.masterName = $scope.name = '46'; |
This file contains 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 'rubygems' | |
require 'right_aws' | |
aws_access_key_id = 'your-access-key' | |
aws_secret_access_key = 'your-secret-key' | |
target_bucket = 'your-source-bucket' | |
destination_bucket = 'your-destination-bucket' | |
s3 = RightAws::S3Interface.new(aws_access_key_id, aws_secret_access_key) |
This file contains 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
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: disable-transparent-hugepages | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Disable Linux transparent huge pages | |
# Description: Disable Linux transparent huge pages, to improve | |
# database performance. | |
### END INIT INFO |
This file contains 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
#import "UWFacebookService.h" | |
@implementation UWFacebookService | |
// Static | |
static const int ddLogLevel = LOG_LEVEL_DEBUG; | |
// Strong | |
@synthesize facebookGraphUser = _facebookGraphUser; |
OlderNewer