Skip to content

Instantly share code, notes, and snippets.

View disruptek's full-sized avatar
🧹
aspiring janetor

Smooth Operator disruptek

🧹
aspiring janetor
View GitHub Profile

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@disruptek
disruptek / gist:8533361
Created January 21, 2014 02:19
rivets/watch adapter
var FlatKey = {
set: function (Obj, keypath, value) {
//console.log("set : " + keypath + " with " + value);
var V = Obj;
var keyArry = keypath.split(".");
keyArry.filter(function (v, i, A) {
return i !== A.length - 1;
}).map(function (v) {
if (V[v] === undefined) {
V[v] = {};
/*
Handlebars Template Engine for Knockout JavaScript library
*//*!
Copyright (c) 2011 Mark J. Titorenko
License: MIT (http://www.opensource.org/licenses/mit-license.php)
*/
ko.handlebarsTemplateEngine = function () {
// adapted from MooTools.Element
//
// This is necessary to allow us to easily deal with table
KO.handlebarsTemplateEngine = function () {
this.allowTemplateRewriting = false;
};
KO.handlebarsTemplateEngine.prototype = KO.utils.extend(new KO.templateEngine(), {
renderTemplate: function (template, bindingContext) {
var HTMLFragment = Handlebars.partials[template](bindingContext);
return KO.utils.parseHtmlFragment(HTMLFragment);
}
});
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <unordered_map>
#include <sys/time.h>
// We specify the total number of systems explicitly so that we can initialize data structures before reading in the whole csv file.
@disruptek
disruptek / index.html
Created March 12, 2016 22:30 — forked from JoshMock/index.html
Infinite scrolling CompositeView
<!DOCTYPE HTML>
<html>
<head>
<style type="text/css" media="all">
#main {
width: 300px;
height: 400px;
overflow: scroll;
}

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@disruptek
disruptek / Readme.md
Created July 8, 2017 23:39 — forked from vicapow/Readme.md
WebGL + d3.layout.force

This demo uses d3.layout.force() to calculate the node positions and then passes those to webGL to render them on the GPU.

@disruptek
disruptek / progressive.index.installation
Created July 11, 2017 22:00
example of progressive index installation/enablement with inspection so you can confirm behavior
graph = JanusGraphFactory.open("conf/gremlin-server/janusgraph-cassandra-es-server.properties")
prop = 'some_property_name'
name = 'by' + prop
size = graph.getOpenTransactions().size()
if(size>0) {for(i=0;i<size;i++) {graph.getOpenTransactions().getAt(0).rollback()}}
graph.getOpenTransactions()
m = graph.openManagement()