This file contains hidden or 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
function map(val, a1, a2, b1, b2) { return ((val - a1) * (b2 -b1)/(a2 - a1)) + b1; } |
This file contains hidden or 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
// https://gist.github.com/304522 | |
// Ported from Stefan Gustavson's java implementation | |
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf | |
// Read Stefan's excellent paper for details on how this code works. | |
// | |
// Sean McCullough banksean@gmail.com | |
/** | |
* You can pass in a random number generator object if you like. | |
* It is assumed to have a random() method. |
This file contains hidden or 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
git checkout develop | |
git log -1 | |
git checkout translation | |
git cherry-pick [commit hash goes here] |
This file contains hidden or 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
index = (y*rows)+x; |
This file contains hidden or 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
Export your Mint data to CSV. | |
Import to Excel or equivalent. | |
Trim the data down to just the date range you need (Mint doesn’t allow this out of the box). | |
Add a few columns to contain your totals and drop in these formulas: | |
=SUMIF(E:E,”debit”,D:D) | |
// Auto & Transport | |
=IF(E:E=”debit”,SUM(SUMIF(F:F,”Auto & Transport”,D:D),SUMIF(F:F,”Auto Insurance”,D:D),SUMIF(F:F,”Auto Payment”,D:D),SUMIF(F:F,”Gas & Fuel”,D:D),SUMIF(F:F,”Parking”,D:D),SUMIF(F:F,”Service & Parts”,D:D),SUMIF(F:F,”Public Transportation”,D:D)),0) |
This file contains hidden or 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
Because I always forget... | |
// Get the angle between two points | |
atan2(y2-y1,x2-x1); | |
// Get the x and y of an object around a radius, given an angle. | |
x = cos(radians(angle)) * radius |
This file contains hidden or 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
var a = function() { | |
var b = function() { | |
var c = function() { | |
var d = function() { | |
var e = function() { | |
var f = function() { | |
var g = function() { | |
var h = function() { | |
var i = function() { | |
var j = function() { |
This file contains hidden or 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
function resizeImage($img,$w,$h) { | |
var maxWidth = $w; | |
var maxHeight = $h; | |
var w = $img.width; | |
var h = $img.height; | |
if(w > h) { | |
if(w > maxWidth) { | |
h *= maxWidth/w; |
This file contains hidden or 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 ls='ls -GFh' | |
export CLICOLOR=1 | |
# From Andrzej Szelachowski's ~/.bash_profile: | |
# Note that a variable may require special treatment | |
#+ if it will be exported. | |
DARKGRAY='\[\e[1;30m\]' |
This file contains hidden or 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
NSLog(@"%@", [NSNumber numberWithInt:i]); | |
/* | |
%@ Object | |
%d, %i signed int | |
%u unsigned int | |
%f float/double | |
%1.2f to controll number of decimals | |
%x, %X hexadecimal int |
OlderNewer