Skip to content

Instantly share code, notes, and snippets.

var greeter = function greet() {
console.log("Hello " + greet.person);
}
greeter.person = "Andy";
greeter();
@jonvuri
jonvuri / Console out
Created June 3, 2015 22:50
Node-gyp build failure
> [email protected] install /Users/jrajav/WorkDev/ldaper/node_modules/ldapauth/node_modules/ldapjs/node_modules/buffertools
> node-gyp rebuild
CXX(target) Release/obj.target/buffertools/buffertools.o
../buffertools.cc:19:52: error: unknown type name 'Arguments'; did you mean
'v8::internal::Arguments'?
Handle<Value> apply(Handle<Object>& buffer, const Arguments& args, HandleScope& scope);
^~~~~~~~~
v8::internal::Arguments
/Users/jrajav/.node-gyp/0.12.2/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments'
var gulp = require('gulp'),
del = require('del'),
changed = require('gulp-changed'),
debug = require('gulp-debug'),
merge = require('merge-stream'),
browserSync = require('browser-sync')
gulp.task('clean', function(cb) {
del(['dist'], cb)
})
@jonvuri
jonvuri / Results
Created July 15, 2014 04:35
Performance of minimatch - .match() versus precompiled .makeRe()
match found: 1566ms
re match found: 77ms
re exec found: 72ms
match not found: 1499ms
re match not found: 51ms
re exec not found: 40ms
negated match found: 1647ms
negated re match found: 49ms
negated re exec found: 43ms
negated match not found: 1527ms
@jonvuri
jonvuri / gist:b55cf3106eb606d82072
Created July 6, 2014 01:49
Related ESLint Rules

Statements that shouldn't bleed through to production code:

  • no-alert
  • no-console
  • no-debugger

Regular expressions

  • no-div-regex
  • no-control-regex
  • no-regex-spaces
@jonvuri
jonvuri / gist:6563197
Created September 14, 2013 16:06
chicken-install iup
retrieving ...
connecting to host "chicken.kitten-technologies.co.uk", port 80 ...
requesting "/henrietta.cgi?name=iup&mode=default" ...
reading response ...
HTTP/1.1 200 OK
Date: Sat, 14 Sep 2013 16:02:19 GMT
Server: Apache/2.2.25 (Unix) mod_ssl/2.2.25 OpenSSL/0.9.9-dev DAV/2 SVN/1.8.1 PHP/5.4.19 mod_fastcgi/2.4.6
Connection: close
Transfer-Encoding: chunked
Content-Type: text/plain
@jonvuri
jonvuri / reqs.txt
Created August 11, 2013 17:49
Save this locally as reqs.txt
django-adminplus
django-multiform
django-openid-auth
django-timezones
gdata
python-dateutil
python-openid
pytz
simplejson
sudo pip install django
sudo pip install south
sudo pip install -r reqs.txt
sudo patch -p1 -d /Library/Python/2.7/site-packages < conditional_aggregates.1.5.patch
git clone [email protected]:/home/public/git/donations
cd donations
@jonvuri
jonvuri / gist:5297363
Created April 3, 2013 00:08
I'm tired - Andy Moore

Original article


Last night was the end of an amazing GDC trip. A handful of remaining friends and I made a journey out to JapanTown and we had an amazing meal. It was a great way to end the trip.

One of my friends, and a fellow game developer, was there for dinner. Her trip to GDC was planned last-minute, thanks to someone obtaining her a (very expensive!) all-access pass.

When recounting this chain of events, a male game developer at the table said that she only got the GDC pass “because of her tits.”

@jonvuri
jonvuri / htmlencode.js
Last active December 15, 2015 04:50
A function to HTML encode a string
function htmlEncode(str) {
return String(str)
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;')
.replace(/\//g, '&#47;');
}