Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
function debugAccess(obj, prop, debugGet){ | |
var origValue = obj[prop]; | |
Object.defineProperty(obj, prop, { | |
get: function () { | |
if ( debugGet ) | |
debugger; | |
return origValue; | |
}, |
var d = new Date(); | |
var usertime = d.toLocaleString(); | |
// Some browsers / OSs provide the timezone name in their local string: | |
var tzsregex = /\b(ACDT|ACST|ACT|ADT|AEDT|AEST|AFT|AKDT|AKST|AMST|AMT|ART|AST|AWDT|AWST|AZOST|AZT|BDT|BIOT|BIT|BOT|BRT|BST|BTT|CAT|CCT|CDT|CEDT|CEST|CET|CHADT|CHAST|CIST|CKT|CLST|CLT|COST|COT|CST|CT|CVT|CXT|CHST|DFT|EAST|EAT|ECT|EDT|EEDT|EEST|EET|EST|FJT|FKST|FKT|GALT|GET|GFT|GILT|GIT|GMT|GST|GYT|HADT|HAEC|HAST|HKT|HMT|HST|ICT|IDT|IRKT|IRST|IST|JST|KRAT|KST|LHST|LINT|MART|MAGT|MDT|MET|MEST|MIT|MSD|MSK|MST|MUT|MYT|NDT|NFT|NPT|NST|NT|NZDT|NZST|OMST|PDT|PETT|PHOT|PKT|PST|RET|SAMT|SAST|SBT|SCT|SGT|SLT|SST|TAHT|THA|UYST|UYT|VET|VLAT|WAT|WEDT|WEST|WET|WST|YAKT|YEKT)\b/gi; | |
// In other browsers the timezone needs to be estimated based on the offset: | |
var timezonenames = {"UTC+0":"GMT","UTC+1":"CET","UTC+2":"EET","UTC+3":"EEDT","UTC+3.5":"IRST","UTC+4":"MSD","UTC+4.5":"AFT","UTC+5":"PKT","UTC+5.5":"IST","UTC+6":"BST","UTC+6.5":"MST","UTC+7":"THA","UTC+8":"AWST","UTC+9":"AWDT","UTC+9.5":"ACST" |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
//Define a function scope, variables used inside it will NOT be globally visible. | |
(function () { | |
var | |
//the HTTP headers to be used by all requests | |
httpHeaders, | |
//the message to be shown to the user | |
message, |
// prevent back/forward gestures when scrolling an element left/right on OS X | |
var preventHistorySwipe = function(element) { | |
// not even on the right platform bro | |
if (navigator.userAgent.indexOf('Macintosh') === -1) return; | |
element.addEventListener('mousewheel', function(e) { | |
var x = e.wheelDeltaX; | |
// scrolling up or down? then i don't give a shit | |
if (x === 0) return; |
/** | |
* A simple map implementation. Uses two arrays to store the keys and values as well as indexOf to search through them. | |
* | |
* You could swap indexOf for a binary search if you need more speed: http://oli.me.uk/2013/06/08/searching-javascript-arrays-with-a-binary-search/ | |
* | |
* @class | |
*/ | |
function Map() { | |
this._createStorage(); | |
} |
// DISCLAIMER: This is not necessarily good code. It’s just code that I wrote | |
// as quickly as possible to do each task. | |
// 1 | |
return 2*i; | |
// 2 | |
return !(i%2); |