I hereby claim:
- I am mkuklis on github.
- I am michal (https://keybase.io/michal) on keybase.
- I have the public key with fingerprint 4CC4 26DF 45A8 5858 B8ED A22C A674 443D E215 6841
To claim this, I am signing this object:
// Extends API with actions | |
const actionsMiddleware = fn => (set, get, api) => { | |
const _actions = {}; | |
api.actions = () => _actions; | |
const state = fn(set, get, api); | |
Object.keys(state).forEach(key => { | |
if (typeof state[key] === 'function') { |
const sharp = require('sharp'); | |
const aws = require('aws-sdk'); | |
const s3 = new aws.S3(); | |
const Bucket = "BucketName"; | |
const transforms = [ | |
{ name: 'small', size: 85 }, | |
{ name: 'medium', size: 160 }, | |
{ name: 'large', size: 250 }, | |
]; |
var storage = { | |
init: function (success, error) { | |
window.requestFileSystem(PERSISTENT, 100 * 1024 * 1024, success, error); | |
}, | |
write: function (fileName, content, success, error) { | |
this.init(function (fs) { | |
fs.root.getFile(fileName, { create: true }, function (fileEntry) { | |
fileEntry.createWriter(function (fileWriter) { | |
fileWriter.onwriteend = callback; |
description "mongodb container" | |
author "ququplay" | |
start on filesystem and started docker | |
stop on runlevel [!2345] | |
respawn | |
script | |
# Wait for docker to finish starting up first. | |
FILE=/var/run/docker.sock | |
while [ ! -e $FILE ] ; do | |
inotifywait -t 2 -e create $(dirname $FILE) |
I hereby claim:
To claim this, I am signing this object:
function run(genfun) { | |
var gen = genfun(); | |
function next(err, answer) { | |
if (err) { | |
return gen.throw(err); | |
} | |
var res = gen.next(answer); | |
function hasWebSocket() { | |
var m = navigator.userAgent.match(/Android ([0-9]+)\.([0-9]+)/i); | |
if (m) { | |
var x = parseInt(m[1], 10); | |
var y = parseInt(m[2], 10); | |
return window.WebSocket && (x > 4 || (x == 4 && y >= 4)); | |
} |
# dump heroku db | |
heroku pgbackups:capture | |
# restore | |
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U postgres -d database_name DUMP_PATH |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
function elo(oldRating, opponentRating, result) { | |
var kFactor; | |
var expected = 1.0 / (1.0 + Math.pow(10.0, ((opponentRating - oldRating) / 400))); | |
if (oldRating < 2100) { | |
kFactor = 32; | |
} else if (oldRating >= 2100 && oldRating <= 2400) { | |
kFactor = 24; | |
} | |
else if (oldRating > 2400) { |