Skip to content

Instantly share code, notes, and snippets.

View kvendrik's full-sized avatar

Koen Vendrik kvendrik

View GitHub Profile
@kvendrik
kvendrik / _git-to-public.py
Last active August 29, 2015 14:10
Simple continuous deployment script
'''
Name: git-to-public
Description: Simple continuous deployment script. Listens for pushes to
Gitlab repositories. When there is a push to the master
branch it clones the repo to the same folder as the script
is in.
Author: Koen Vendrik <[email protected]>
Date: 22/11/2014
License: MIT
@kvendrik
kvendrik / aliases-todo.md
Last active August 29, 2015 14:18
Git Merge 2015 Notes
  • mkdir -p && cd
  • g clone <url> && cd
  • gs=git status
@kvendrik
kvendrik / main.js
Last active August 29, 2015 14:23
Sketch JSON Parser
var doc = context.document,
app = [NSApplication sharedApplication],
jsonStr = [doc askForUserInput:"Enter the JSON you'd like to use" initialValue:""],
json;
try {
json = JSON.parse(jsonStr);
} catch(e){
[app displayDialog:"Whoops, looks like that's not valid JSON."]
return;
@kvendrik
kvendrik / example.js
Last active August 29, 2015 14:26
Gets first <count> card titles of a Trello list (<listName>) and puts them into a string you can then use to paste them onto another board.
console.log(
getTrelloListItemsStr('Ready for Dev', 9)
);
@kvendrik
kvendrik / _cordova-pm.py
Last active September 7, 2015 12:58
Small Cordova Plugin Manager Script
#!/usr/bin/env python
import json
import sys
import subprocess
import argparse
import re
parser = argparse.ArgumentParser(description='Cordova Package Manager')
@kvendrik
kvendrik / README.md
Last active August 30, 2015 12:20
Managing Multiple SSH Keys

With this set up I can clone with my default key as Bitbucket suggests:

git clone [email protected]:username/project.git

If I want to clone a repository from my second account I can alter the command to use the second SSH key I generated:

git clone git@bitbucket-accountB:username/project.git
@kvendrik
kvendrik / _build-android-apk.sh
Created September 12, 2015 09:10
Build Android APK
if [ -z "$1" -o -z "$2" ] ; then
printf 'Please supply a APK name and semver string\nusage: _build-android-apk <APK_NAME> <SEMVER_STRING>'
exit 1
fi
APK_NAME=$1
SEMVER_STRING=$2
function check_certificate(){
# create key if not present
@kvendrik
kvendrik / Makefile
Last active October 2, 2015 13:22
indexlang
all: prep
prep:
mv compiler.js compiler
mv converter.js converter
chmod 755 compiler converter
@kvendrik
kvendrik / README.md
Last active October 23, 2015 18:44
Hash Method
  1. Construct unique array of letters, numbers and special chars (matrix)
  2. Add a random number of chars to each variable
  3. Replace every char in the input with a set of chars from the list

Hash key could be based on: (make sure the same strings have equal hashes)

  • String Length
  • Take every chars alphabetic index and use the total as the key to generating the hash
Ideas

x = total alphabetic index number of input

var ListenersHelper = function(){
this._listeners = {};
};
ListenersHelper.prototype.on = function(event, callback){
if(typeof this._listeners[event] !== 'object'){
this._listeners[event] = [];
}
this._listeners[event].push(callback);
};