Skip to content

Instantly share code, notes, and snippets.

View tristanz's full-sized avatar
💭
Working on Continual

Tristan Zajonc tristanz

💭
Working on Continual
View GitHub Profile
mkdir ~/usr
wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
tar -zxvf ta-lib-0.4.0-src.tar.gz
cd ta-lib
./configure --prefix=$HOME/usr
make
make install
cd ..
rm -rf ta-lib
pip install --allow-external TA-Lib --allow-unverified TA-lib --user
@tristanz
tristanz / gist:b02ad69cacf768453e47
Created September 6, 2014 22:53
Handle Backspace and Special Characters in Text
applyRewrites = (txt) =>
txt = txt.replace /\r\n/g, "\n"
sofar = ""
remaining = txt
lineBreaks = []
rewritten = false
while m = /[\b\r\n]/.exec(remaining)
switch m[0]
when "\b"
# Handle backspaces. Add everything up to the backspace, then pop off the last character.
#cloud-config
coreos:
etcd:
addr: $public_ipv4:4001
peer-addr: $public_ipv4:7001
peers: 172.17.8.101:7001,172.17.8.101:7002
units:
- name: etcd.service
command: start
(function() {
console.log('cartodb');
var INCLUDE_GMAPS = false ;
var VIZJSON_URL = 'https://sense.cartodb.com/api/v1/viz/15450/viz';
var ACCOUNT_TYPE = "free";
var IS_CUSTOM_INSTALL = false;
var doc = document;
var head = doc.getElementsByTagName('head')[0];
@tristanz
tristanz / README.md
Created July 31, 2012 06:13 — forked from mbostock/.block
Histogram
@tristanz
tristanz / complex.cc
Created February 22, 2012 18:55
Node module in header file
#include <node.h>
#include "complex.hpp"
using namespace v8;
void RegisterModule(Handle<Object> target) {
MyObject::Init(target);
}
NODE_MODULE(complex, RegisterModule);
@tristanz
tristanz / modulename.cpp
Created December 28, 2011 03:02
Node Header Module
#include <node.h>
#include "modulename.hpp"
using namespace v8;
void RegisterModule(Handle<Object> target) {
MyObject::Init(target);
}
@tristanz
tristanz / matmul.boo
Created October 9, 2011 20:38
Boo vs C# performance
import System
// Written by Attractive Chaos; distributed under the MIT license
// To compile: mcs -optimize+ -out:matmul_v1.run matmul_v1.cs
// Translated from Java with reference to: http://code.wikia.com/wiki/Matrix_multiplication
internal class matmul_v1:
circle.node {
stroke: #fff;
stroke-width: 1.5px;
}
line.link {
stroke: #999;
stroke-opacity: .6;
}
@tristanz
tristanz / gist:640071
Created October 22, 2010 06:52
Problem binding functions with variables within a template.
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="http://nje.github.com/jquery-tmpl/jquery.tmpl.js"></script>
<script src="http://github.com/downloads/SteveSanderson/knockout/knockout-1.1.0.js"></script>
</head>
<body>
<div data-bind="template: 'myTemplate'"></div>
<script id="myTemplate" type="text/html" >