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
#The power of z, copied from https://gist.github.com/mischah/8149239 | |
Do you spend lots of time doing things like this? | |
cd this/is/the/path/that/i/want/so/i/type/it/all/out/to/get/whereiwant | |
With z, you could just do this: | |
z whereiwant | |
See README of z for all available options. |
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
alias scs='source ~/.bashrc' | |
alias seebs='open -a TextEdit ~/.bashrc' | |
alias ls='ls -FGOp' | |
alias la='ls -FGOla' | |
alias lsg='ls -a | grep -ie ' | |
alias lsl='ls | less' | |
alias h='history' | |
# git ############## |
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
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
# generate server.xml with the following command: | |
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
# run as follows: | |
# python simple-https-server.py | |
# then in your browser, visit: | |
# https://localhost:4443 | |
import BaseHTTPServer, SimpleHTTPServer | |
import ssl |
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
/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm | |
// JavaScript: | |
// source_string.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm, '$1'); | |
// PHP: | |
// preg_replace("/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/m", "$1", $source_string); |
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
/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm | |
// JavaScript: | |
// source_string.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm, '$1'); | |
// PHP: | |
// preg_replace("/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/m", "$1", $source_string); |
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
$('#container').highcharts({ | |
chart: { | |
alignTicks: true, // When using multiple axis, the ticks of two or more opposite axes will automatically be aligned by adding ticks to the axis or axes with the least ticks. | |
animation: true, // Set the overall animation for all chart updating. Animation can be disabled throughout the chart by setting it to false here. | |
backgroundColor: '#FFF', // The background color or gradient for the outer chart area. | |
borderColor: '#4572A7', // The color of the outer chart border. | |
borderRadius: 5, // The corner radius of the outer chart border. In export, the radius defaults to 0. Defaults to 5. | |
borderWidth: 0, // The pixel width of the outer chart border. | |
className: null, // A CSS class name to apply to the charts container div, allowing unique CSS styling for each chart. | |
defaultSeriesType: 'line', // Alias of type. |
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
// calcuate barycentric coordinates (u,v,w) for point p with respect to triangle (a,b,c) | |
// use 3d PVector to store u,v,w | |
// https://en.wikipedia.org/wiki/Barycentric_coordinate_system | |
PVector getBaryCentric(PVector p, PVector a, PVector b, PVector c) { | |
PVector v0 = PVector.sub(b, a); | |
PVector v1 = PVector.sub(c, a); | |
PVector v2 = PVector.sub(p, a); | |
float den = v0.x * v1.y - v1.x * v0.y; | |
float v = (v2.x * v1.y - v1.x * v2.y) / den; |
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
// calcuate center point from given three points | |
// http://paulbourke.net/geometry/circlesphere/ | |
PVector calculateCenter(PVector p1, PVector p2, PVector p3) { | |
float ma = (p2.y - p1.y) / (p2.x - p1.x); | |
float mb = (p3.y - p2.y) / (p3.x - p2.x); | |
float x = (ma * mb * (p1.y - p3.y) + mb * (p1.x + p2.x) - ma * (p2.x + p3.x)) / ( 2 * (mb - ma)); | |
float y = (p1.x - p3.x + ma * (p1.y + p2.y) - mb * (p2.y + p3.y)) / (2 * (ma - mb)); | |
return new PVector(x, y); | |
} |
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
# From https://github.com/wnyc/PIL/blob/master/Scripts/gifmaker.py | |
# | |
# The Python Imaging Library | |
# $Id$ | |
# | |
# convert sequence format to GIF animation | |
# | |
# history: | |
# 97-01-03 fl created | |
# |
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
/** | |
* Grid Setup | |
* Modified from http://matthewsimo.github.io/scss-flex-grid/ | |
*/ | |
$ps-columns: 12 !default; | |
$ps-gutter: 0.5rem !default; | |
/** | |
* Break point namespace object | |
* |
NewerOlder