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
// Anonymize | |
(function () { | |
Function.prototype.callAsync = function () { | |
var self = this, args = arguments, result = {returned:false}; | |
setTimeout(function () { result.returnVal = self.apply(self, args); result.returned = true; }, 0); | |
return result; | |
} | |
})(); |
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
Blatantly borrowed from StackOverflow | |
Uninstall MySQL 5.6.12: | |
brew unlink mysql | |
brew uninstall mysql | |
Go to the homebrew directory: | |
cd /usr/local | |
Go to version 5.6.10 (you can find a list of versions by running brew versions mysql: |
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
class Request : NSObject { | |
func send(url: String, f: (String)-> ()) { | |
var request = NSURLRequest(URL: NSURL(string: url)) | |
var response: NSURLResponse? | |
var error: NSErrorPointer = nil | |
var data = NSURLConnection.sendSynchronousRequest(request, returningResponse: &response, error: error) | |
var reply = NSString(data: data, encoding: NSUTF8StringEncoding) | |
f(reply) | |
} |
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
#!/usr/bin/env python | |
'''docclass.py: Language classifier''' | |
__author__ = "Rob Skillington" | |
from math import sqrt, log | |
import re, os, sys, getopt | |
DEFAULTS = { |
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
(function () { | |
function c() { | |
var e = document.createElement("link"); | |
e.setAttribute("type", "text/css"); | |
e.setAttribute("rel", "stylesheet"); | |
e.setAttribute("href", f); | |
e.setAttribute("class", l); | |
document.body.appendChild(e) | |
} | |
function h() { |
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
#!/usr/bin/env coffee | |
readline = require 'readline' | |
rl = readline.createInterface | |
input: process.stdin | |
terminal: false | |
stat = {add: 0, del: 0} |
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
extension Dictionary { | |
func valueForKey<T>(key: Key) -> T? { | |
if let value = self[key] as? T { | |
return value | |
} else { | |
return nil | |
} | |
} | |
} |
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
#!/usr/bin/env ruby | |
#vim:syntax=ruby | |
# Most of this borrowed from: | |
# https://github.com/ripienaar/monitoring-scripts/blob/master/puppet/check_puppet.rb | |
# A simple nagios check that should be run as root | |
# perhaps under the mcollective NRPE plugin and | |
# can check when the last run was done of puppet. | |
# It can also check fail counts and skip machines | |
# that are not enabled |
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
javascript:(function(){ window.addEventListener('keydown', function(e) {if (e.ctrlKey && e.keyCode == 13) { $('#compilerun').click(); }}); }()) |
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
package main | |
import ( | |
"fmt" | |
) | |
type Options struct { | |
foo int | |
bar string | |
} |
OlderNewer