This is my first gist
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 node | |
function trace(base) { | |
return function() { | |
console.log('called at:', new Error().stack.split('\n')[2].trim()); | |
return base.apply(this, arguments); | |
}; | |
} | |
var path = require('path'); | |
path.exists = trace(path.exists); |
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
var csvdb = require('csvdb'); | |
var express = require('express'); | |
var path = require('path'); | |
// | |
// Returns an `express` middleware that can used to | |
// `source` is the url of the csv source (required) | |
// `options.filter` is a function called for each entry in `source` and allows one to filter the served results (default is no filter). | |
// `options.autofetch` is an interval for autofetching from source (default 5000ms). | |
// `options.view` is the name of a view to render when requests come in with `http` in their `accept` header (optional). |
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
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
[self hopTo:@"splash" then:^{ | |
[self hopTo:@"onboarding" then:^{ | |
[self login]; | |
}]; | |
}]; | |
} |
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
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context | |
{ | |
if ([keyPath isEqualToString:@"currentUser"]) { | |
if (self.currentUser) { | |
[self hopTo:@"main" then:nil]; | |
} | |
else { | |
[self hopTo:@"signup_login" then: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
- (void)setupCamera | |
{ | |
self.coreImageContext = [CIContext contextWithOptions:nil]; | |
// session | |
self.cameraSession = [[AVCaptureSession alloc] init]; | |
[self.cameraSession setSessionPreset:AVCaptureSessionPresetPhoto]; | |
[self.cameraSession commitConfiguration]; | |
// input |
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 | |
# | |
# relnotes.rb | |
# Markdown release notes since last bump commit with github links | |
# Awesome for creating release notes for a release. | |
# | |
# Usage: ruby relnotes.rb [github-prefix] | |
# | |
# The script will extract all git commits since the last "bump commit" (a commit with the text "bump") | |
# and will generate a bulletted description of all the commits. If `github-prefix` is provided (e.g. "eladb/myrepo"), |
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 | |
set -eu # we don't want "pipefail" to implement idempotency | |
### | |
# Usage: ./publish-mvn.sh | |
# | |
# Publishes the content of an offline Maven repository to Maven Central. | |
# | |
# This script expects the following environment variables to be set to appropriate | |
# values (which can be achieved by using scripts/with-signing-key.sh): |
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 | |
set -euo pipefail | |
# given an aws-cdk bundle archive (the one published to github releases), extract | |
# all .jsii manifests and places them under "jsii/*.jsii" | |
# now they can be used with jsii-reflect | |
zip=${1:-} | |
if [ -z "${zip}" ]; then | |
echo "Usage: $(basename $0) <cdk-bundle-zip>" |
const markets = {
'US': { region: 'us-east-1', account: '1234' },
'EU': { region: 'eu-west-2', account: '3333' },
};
interface MyThingProps {
market: string;