- pgx_list_dbs: Lists the names of databases in an .sql file dumped using pg_dumpall.
- pgx_extract_db: Extracts a single database from a sql file dumped with pg_dumpall and outputs its content to stdout.
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
// for multiple requests | |
let isRefreshing = false; | |
let failedQueue = []; | |
const processQueue = (error, token = null) => { | |
failedQueue.forEach(prom => { | |
if (error) { | |
prom.reject(error); | |
} else { | |
prom.resolve(token); |
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
////Constants ////////////////////////////////////////////// | |
function jsonOk (body) { | |
var mockResponse = new window.Response(JSON.stringify(body), { //the fetch API returns a resolved window Response object | |
status: 200, | |
headers: { | |
'Content-type': 'application/json' | |
} | |
}); |
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 | |
# | |
# ---------------------------------------------------------------------------- | |
# "THE BEER-WARE LICENSE" (Revision 42): | |
# <dev@robertweidlich.de> wrote this file. As long as you retain this notice you | |
# can do whatever you want with this stuff. If we meet some day, and you think | |
# this stuff is worth it, you can buy me a beer in return. | |
# ---------------------------------------------------------------------------- | |
# |
I just realized that there is a rather well hidden javascript interpreter in the mac os x terminal out of the box. /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc See http://www.phpied.com/javascript-shell-scripting/
Then i figured it coud be quite easy to set up a command line util to run jslint from anywhere. Thought i´d share how.
- Download and unzip this gist.
- Download Douglas Crockfords jslint from here https://github.com/douglascrockford/JSLint/raw/master/fulljslint.js.
- Edit the 'jslint' shell script and set the paths to where you saved the .js files.
- Chmod the 'jslint' shell script (
chmod +x
)
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
/* | |
- Trivial wrapper around system sound as provided by Audio Services. | |
- Don’t forget to link against the Audio Toolbox framework. | |
- Assumes ARC support. | |
*/ | |
@interface Sound : NSObject | |
// Path is relative to the resources dir. | |
- (id) initWithPath: (NSString*) path; |