Skip to content

Instantly share code, notes, and snippets.

View juliankrispel's full-sized avatar

Julian Krispel juliankrispel

View GitHub Profile
@juliankrispel
juliankrispel / git_dreamhost_deploy.sh
Created April 16, 2016 03:44
git dreamhost deploy
#!/bin/sh
#
# This hook does two things:
#
# 1. update the "info" files that allow the list of references to be
# queries over dumb transports such as http
#
# 2. if this repository looks like it is a non-bare repository, and
# the checked-out branch is pushed to, then update the working copy.
# This makes "push" function somewhat similarly to darcs and bzr.
var express = require('express');
var app = express();
var request = require('request');
var protocol = 'https';
var port = 5000;
var _ = require('lodash');
var path = require('path');
var proxyUrl = 'app.rnfrstqa.com';
var makeUrl = function(url){
@juliankrispel
juliankrispel / rainforest-follow.js
Last active August 29, 2015 14:13
rainforest test
// Only works on letsrevolutionizetesting.com/challenge since CORS
// is disabled and jquery is included on that page
var getRecursive = function(url){
return $.ajax({url: url, dataType: 'json'})
.then(function(res){
if(res.hasOwnProperty('follow')){
return getRecursive(res.follow);
}else{
return res;
@juliankrispel
juliankrispel / knockout-template-function.js
Created November 3, 2014 10:53
knockout.js component template function
// Add component
var inputComponentLoader = {
loadComponent: function(name, config, callback) {
if(u.isType(config.template, 'function')){
var template = ko.utils.parseHtmlFragment(config.template(config));
callback({
template: template,
createViewModel: createViewModelForInput
});
}else{

Date: [date]

Between us [company name] and you [customer name].

Summary:

In short; neither of us will share any confidential information about each-other, by any means, with anyone else.

What’s confidential information?

@juliankrispel
juliankrispel / deepclone.js
Last active August 29, 2015 14:02
a little deep clone function
var clone = function(thing){
switch(is(thing)){
case 'object':
var newobj = {};
for (var key in thing){
newobj[key] = clone(thing[key]);
}
return newobj;
case 'array':
@juliankrispel
juliankrispel / vim_cheatsheet.md
Created January 23, 2014 10:08
vim cheatsheet

" Don't quit visual mode after indenting :vmap < >gv

@juliankrispel
juliankrispel / angular-drag-events.js
Last active December 31, 2015 14:38
simple drag events as angular directives
var directives = ['drag', 'dragstart', 'dragend', 'dragover', 'dragenter', 'drop'];
// The HTML5 drag and drop api is the most stupid thing
// I've ever seen, but I'm going to use it anyway.
angular.forEach(directives, function(dir){
app.directive(dir, [function () {
return {
restrict: "A",
scope: false,
@juliankrispel
juliankrispel / dragAndDropLayoutSpec.md
Last active December 31, 2015 01:19
drag and drop layout blocks (spec)

Drag and Drop Layouts

Outline

A document would be simply, an array of objects, visually sortable through a drag and drop interface.

Each object in this array represents a draggable html element rendered on the page. When dragged over another the aforementioned array is resorted. Whenever the array resorts, it will rerender its' contents to the page.

An example of the array of objects that represents a document

documentA = [
@juliankrispel
juliankrispel / quicksort.coffee
Created October 28, 2013 07:05
A quicksort implementation in CoffeeScript
arr = [900, 1, 39, 12, 8, 15, 39, 11, 100]
quicksort = (arr) ->
if(arr.length < 2)
return arr
unless arr or arr.length > 1
throw new Error 'Input invalid'
pivot = arr[0]