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
gem "octokit", "~> 4.0" |
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
mutator.transform('myPipeName', msg => `${msg} my transformation` as TransformStream) | |
mutator.transform('myPipeName', msg => Promise.resolve(`${msg} my transformation promise`) as TransformStream) | |
mutator.transform('myPipeName', msg => Observable.of(`${msg} my transformation observable`) as TransformStream) |
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 { Observable } from 'rxjs' | |
import { | |
MutatorIO, | |
InputStream, | |
OutputStream | |
} from 'mutator-io' | |
const myPipe = { | |
name: 'myPipeName', | |
in: { | |
create: () => Observable.of('My message', 'My other message') |
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
function generateParametersList (name = '', params) { | |
return _.chain(params) | |
.uniq() | |
.map((param, i) => ({ [`:${name}${i}`]: param })) | |
.reduce((acc, curr) => ({ ...acc, ...curr })) | |
.value() | |
} | |
const typesMapping = generateParametersList('type', types) | |
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 input = [[1,2,[3]],4]; | |
const output = [1,2,3,4]; | |
function *flatten(arr) { | |
for (value of arr) { | |
if (Array.isArray(value)) { | |
yield *flatten(value); | |
} else { | |
yield value; | |
} |
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
### Keybase proof | |
I hereby claim: | |
* I am vshjxyz on github. | |
* I am delbianco (https://keybase.io/delbianco) on keybase. | |
* I have a public key whose fingerprint is 0058 0111 18B8 C588 2A4A C699 87E9 D63E F220 B01A | |
To claim this, I am signing this object: |
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 handler = (request, response) => response('Hello, World!'); | |
const routes = { | |
home: handler, | |
foo: { | |
bar: handler, | |
baz: handler, | |
qux: handler | |
}, | |
ids: { | |
1: handler, |
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
function *fib(iterations=10, val1=0, val2=1) { | |
if (iterations > 0) { | |
let sum = val1 + val2; | |
yield sum; | |
yield *fib(iterations - 1, val2, sum); | |
} | |
} | |
[...fib()].map((val) => console.log(val)); |
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
# Path to your oh-my-zsh installation. | |
export ZSH=/Users/developer/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="gianu" | |
# Uncomment the following line to use case-sensitive completion. |
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
http = require "http" | |
https = require "https" | |
### | |
getJSON: REST get request returning JSON object(s) | |
@param options: http options object | |
@param callback: callback to pass the results JSON object(s) back | |
### | |
exports.getJSON = (options, onResult) -> | |
console.log "---> #{options.method} ~ #{options.host}:#{options.port}#{options.path}" |
NewerOlder