Skip to content

Instantly share code, notes, and snippets.

Three, one, four, one, z, z, z...

Filip Dupanović langri-sha

Three, one, four, one, z, z, z...
Block or report user

Report or block langri-sha

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
matttti / effect-generators.js
Created Jan 28, 2017
[redux-saga]: flow-typing of yield return values
View effect-generators.js
import * as IOEffects from 'redux-saga/effects'
export function * select (...args) {
return yield
export function * put (...args) {
return yield IOEffects.put(...args)
View protractor-mocha-tags.js
// Note: ES6 syntax requires a version of Node.js >= 4.0.0
'use strict';
// Can use any lib (or none, if you choose) to parse args.
// "npm install yargs --save" to use this example as-is
let argv = require('yargs').argv;
const DELIMITER = ',';
const TAG_IDENT = '#';
let tagsOpt = typeof argv.tags === 'string' && argv.tags;
lmakarov /
Created Jun 30, 2015
Install docker-compose in boot2docker 1.7.0+
# Download docker-compose to the permanent storage
echo 'Downloading docker-compose to the permanent VM storage...'
sudo mkdir -p /var/lib/boot2docker/bin
sudo curl -sL${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o /var/lib/boot2docker/bin/docker-compose
sudo chmod +x /var/lib/boot2docker/bin/docker-compose
sudo ln -sf /var/lib/boot2docker/bin/docker-compose /usr/local/bin/docker-compose
domenic /
Last active Jul 9, 2019
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with Travis

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

Create a compile script

You want a script that does a local compile to e.g. an out/ directory. Let's call this for our purposes, but for your project it might be npm build or gulp make-docs or anything similar.

The out/ directory should contain everything you want deployed to gh-pages. That almost always includes an index.html.

skeggse / crypto-pbkdf2-example.js
Last active Jun 19, 2019
Example of using crypto.pbkdf2 to hash and verify passwords asynchronously, while storing the hash and salt in a single combined buffer along with the original hash settings
View crypto-pbkdf2-example.js
var crypto = require('crypto');
// larger numbers mean better security, less
var config = {
// size of the generated hash
hashBytes: 32,
// larger salt means hashed passwords are more resistant to rainbow table, but
// you get diminishing returns pretty fast
saltBytes: 16,
// more iterations means an attacker has to take longer to brute force an
FIELDS = ['cmd', 'command', 'start', 'end', 'delta', 'msg', 'stdout', 'stderr']
def human_log(res):
if type(res) == type(dict()):
for field in FIELDS:
if field in res.keys():
encoded_field = res[field].encode('utf-8')
print '\n{0}:\n{1}'.format(field, encoded_field)
staltz /
Last active Aug 23, 2019
The introduction to Reactive Programming you've been missing
# This gist is compatible with Ansible 1.x .
# For Ansible 2.x , please check out:
# -
# -
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
soarez /
Last active Aug 22, 2019
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

jouni-kantola / stub-properties-and-methods-sinon.js
Created Feb 2, 2014
Sinon.JS used to stub properties and methods in a sandbox. Methods and properties are restored after test(s) are run.
View stub-properties-and-methods-sinon.js
define(['can', 'localCache'], function(can, localCache) {
'use strict';
describe('storeLocal()', function() {
var sandbox;
beforeEach(function() {
// create sandbox environment for mocking about
sandbox = sinon.sandbox.create();
You can’t perform that action at this time.