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
const express = require('express'); | |
const app = express(); | |
// Application | |
app.get('/', function(req, res) { | |
if (process.env.NODE_ENV === 'development') { | |
for (var key in require.cache) { | |
delete require.cache[key]; | |
} | |
} |
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
#!/bin/bash | |
# | |
# An example hook script to make use of push options. | |
# The example simply echoes all push options that start with 'echoback=' | |
# and rejects all pushes when the "reject" push option is used. | |
# | |
# To enable this hook, rename this file to "pre-receive". | |
# check if back merges are happening from important branches | |
echo "checking for bad branch names" |
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
// Examples are: "tell application \"Google Chrome\" to return URL of front document" | |
// Other web app specific versions here: https://gist.github.com/vitorgalvao/5392178 | |
let myAppleScript = "..." | |
var error: NSDictionary? | |
if let scriptObject = NSAppleScript(source: myAppleScript) { | |
if let output: NSAppleEventDescriptor = scriptObject.executeAndReturnError(&error) { | |
if let result = output.stringValue { | |
print(output.stringValue) | |
} | |
} else if (error != nil) { |
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
import Foundation | |
public func profiling<R>(label: String, @noescape _ block: () -> R) -> R { | |
NSLog("*** %@...", label) | |
let start = NSDate() | |
defer { | |
let end = NSDate() | |
NSLog("*** %@ took %5.3g seconds", label, end.timeIntervalSinceDate(start)) | |
} | |
return block() |
NewerOlder