I hereby claim:
- I am sixfeetover on github.
- I am jfraser (https://keybase.io/jfraser) on keybase.
- I have a public key whose fingerprint is 171F 5899 D1D1 A4AA 9CAE 426E 7697 D217 D593 A104
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| #!/usr/bin/ruby | |
| # Create display override file to force Mac OS X to use RGB mode for Display | |
| # see http://embdev.net/topic/284710 | |
| require 'base64' | |
| data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` | |
| edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten | |
| vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten |
| create type GKCTable as table ( | |
| id int, | |
| description varchar(255) | |
| ) | |
| go | |
| create procedure dbo.PrintGKC(@gkc_table GKCTable readonly) | |
| as | |
| select * |
| require 'redis' | |
| require 'hiredis' | |
| require "redis/connection/hiredis" | |
| total = 0 | |
| conn = Redis.new(db: 1, driver: :hiredis, path: '/tmp/redis.sock') | |
| (1000...1100).each do |section| | |
| key = "section:#{section}" |
| # Sources: | |
| # http://robots.thoughtbot.com/post/27985816073/the-hitchhikers-guide-to-riding-a-mountain-lion | |
| # https://github.com/sstephenson/ruby-build#special-environment-variables | |
| # Install command line tools from https://developer.apple.com/downloads/index.action. Then: | |
| sudo chown -R `whoami` /usr/local | |
| brew update | |
| brew upgrade rbenv |
| module ActiveRecord | |
| module ConnectionAdapters | |
| class SQLServerAdapter < AbstractAdapter | |
| def configure_connection | |
| raw_connection_do "set concat_null_yields_null on; set nocount on;" | |
| end | |
| end | |
| end | |
| end |
| require 'benchmark' | |
| n = 1_000_000 | |
| def key_arr(prefix, id, *suffixes) | |
| [prefix, id, suffixes].flatten.compact.join ":" | |
| end | |
| def key_str1(prefix, id, *suffixes) | |
| "#{prefix}:#{id}:#{suffixes.flatten.compact.join(':')}" |
| # Ruby 1.9.3-p125 | |
| require 'benchmark' | |
| variable = 'string' | |
| integer = 5 | |
| n = 1_000_000 | |
| Benchmark.bm do |x| | |
| x.report("array:") do |
| # put this in lib | |
| module Merb | |
| module PartsMixin | |
| # Dispatches a PartController. | |
| # ==== Parameters | |
| # opts<Hash>:: A Hash of Options. (see below) | |
| # | |
| # ==== Options | |
| # An option hash has two parts. |
| import sublime, sublime_plugin | |
| import os | |
| class DetectFileTypeCommand(sublime_plugin.EventListener): | |
| """ Detects current file type if the file's extension isn't conclusive """ | |
| """ Modified for Ruby on Rails and Sublime Text 2 """ | |
| """ Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """ | |
| def on_load(self, view): | |
| filename = view.file_name() |