This file contains hidden or 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
| input { | |
| -webkit-appearance: none; | |
| -moz-appearance: none; | |
| } |
This file contains hidden or 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
| /* | |
| Usage: | |
| 1. Initialize | |
| MiniMapper *m = [MiniMapper new]; | |
| 2. Map | |
| [m forClass:[MyClass class] mapAttributes:^(NSMutableDictionary *dict) { | |
| [dict setObject:@"my_attribute" | |
| forKey:@"my_property"]; |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require 'json' | |
| def group_time_by_hosts(raw) | |
| result = {} | |
| raw["log"]["entries"].each do |entry| | |
| url = entry["request"]["url"] | |
| addr = url.split('/')[2] | |
| addr = addr.split('.')[-2..-1] if addr |
This file contains hidden or 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
| # Mac | |
| IO.popen('pbcopy', 'r+') { |clipboard| clipboard.puts html_out } | |
| # Linux | |
| IO.popen(’xsel –clipboard –input’, ‘r+’) { |clipboard| clipboard.puts html_out } |
This file contains hidden or 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
| #define SuperRandom (arc4random() % ((unsigned)RAND_MAX + 1)) | |
| float objectiveFunction(NSArray *vector) { | |
| float result = 0.0; | |
| for (id element in vector) { | |
| result += [element floatValue]; | |
| } | |
| return result; | |
| } |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'nokogiri' | |
| require 'open-uri' | |
| heroku_status_url = "https://status.heroku.com" | |
| doc = Nokogiri::HTML(open(heroku_status_url)) | |
| problems, problem_types = [], { "app" => "App Operations", "tools" => "Tools" } |
This file contains hidden or 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
| git branch -m old_branch new_branch |
This file contains hidden or 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 'JSON' | |
| puts JSON.pretty_generate(JSON.parse('{"array":[1,2,3,{"sample":"hash"}],"foo":"bar"}')) | |
| { | |
| "array": [ | |
| 1, | |
| 2, | |
| 3, | |
| { |
This file contains hidden or 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
| :read !pbpaste | |
| bash$ pbpaste | vim - | |
| "*P |
This file contains hidden or 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
| module MyCoolModule | |
| class Configuration | |
| attr_accessor :my_value | |
| def initialize | |
| # set defaults | |
| end | |
| end | |
| def self.configure |