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
class ChunkingObjectStream extends WriteableStream { | |
constructor(options) { | |
options.objectMode = true; | |
super(options); | |
this.chunkSize = options.chunkSize || 100; | |
this.queue = []; | |
this.counter = 0; | |
this.emitted = 0; |
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
export default function storeFactory(obj) { | |
var element = document.createElement('div'); | |
element.setAttribute('data-store', true); | |
var store = {}; | |
store._element = element; | |
store._listeners = {}; | |
store.listen = (name, callback) => { | |
element.addEventListener(name, e => { |
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
export function dispatch(el, eventName, payload) { | |
el || (el = document); | |
el = el.el || el; | |
var event = new CustomEvent(eventName); | |
event.details = payload || {}; | |
el.dispatchEvent(event); | |
} | |
export function listen(el, eventName, callback) { | |
el || (el = document); |
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
const fs = require('fs'); | |
const qs = require('querystring'); | |
const buf = fs.readFileSync('.env').toString(); | |
const env = qs.parse(buf, "\n"); | |
function getHash(env) { | |
return new Promise((resolve, reject) => { | |
require('child_process').exec('git rev-parse HEAD', (err, hash) => { | |
if(err) return reject(err); | |
env.COMMIT_HASH = hash; |
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
#!/bin/bash | |
PRIME_MODE=`prime-select query` | |
IS_NVIDIA=false | |
if [ "$PRIME_MODE" == "nvidia" ]; then | |
IS_NVIDIA=true | |
fi |
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
package io.inbot; | |
import com.github.jsonj.JsonObject; | |
import com.github.jsonj.tools.JsonParser; | |
import java.io.File; | |
import java.io.IOException; | |
import java.nio.charset.Charset; | |
import java.security.InvalidKeyException; |
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
# It'd be great to get this running via AppleScript and sans Alfred if anyone with more knowledge than me knows how :) | |
### STEP 1 | |
#!/bin/sh | |
# Save this file as /bin/rvm_ruby, and do chmod 755 /bin/rvm_ruby | |
# to give it the proper permissions | |
# From http://www.aeonscope.net/2011/05/29/connecting-alfred-to-bitly-via-ruby/ | |
if [[ -s ~/.rvm/scripts/rvm ]]; then |
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
set :application, "appname" | |
set :deploy_to, "/var/www" | |
set :scm, :git | |
set :repository, "git@github.com:user/app.git" | |
default_run_options[:pty] = true | |
set :user, "www-data" | |
set :domain, "foo.tld" | |
set :normalize_asset_timestamps, false |
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
# add these modifications to your path | |
export PATH="$HOME/bin:$PATH" | |
# activate NVM | |
. ~/.nvm/nvm.sh |
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
import base64 | |
from StringIO import StringIO | |
from django.http import HttpResponse | |
from django.utils import simplejson | |
from easydict import EasyDict as edict | |
from landez import TilesManager | |
from . import app_settings |