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
// Playground - noun: a place where people can play | |
// https://developer.apple.com/library/prerelease/ios/navigation/index.html | |
import Cocoa | |
// variables | |
var string = "Hello, playground" |
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
These are my notes from my abandoned project to wipe and reuse a Google Search Appliance: | |
Dell PowerEdge 2950 (model EMS01) | |
http://support.dell.com/support/edocs/systems/pe2950/en/hom/html/index.htm | |
Disable BIOS Password | |
http://support.dell.com/support/edocs/systems/pe2950/en/hom/html/jumpers.htm#wp1054535 |
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 'sinatra' | |
require 'json' | |
post '/example' do | |
sleep 5 | |
if request.accept?('application/json') | |
content_type :json | |
data = JSON.parse request.body.read | |
data[:status] = 'OK' | |
data.to_json |
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 'digest/sha1' | |
class User | |
=begin | |
u = User.new | |
u.set_password "hello" | |
u.sign_in "hello" | |
=> true | |
u.sign_in "blah" |
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
# A more elegant solution for: http://thedailywtf.com/Articles/Got_Time_0x3f_.aspx | |
class DH | |
def hours_to_days_and_hours(hours) | |
self.send "days_and_hours_in_#{hours}_hours" | |
end | |
def method_missing(method) | |
method.to_s.match(/(\d+)/) |