Skip to content

Instantly share code, notes, and snippets.

View ianstormtaylor's full-sized avatar
🖖

Ian Storm Taylor ianstormtaylor

🖖
View GitHub Profile
@jnwheeler44
jnwheeler44 / circle.yml
Created December 29, 2016 19:34
How to use Postgres 9.6.1 on circleci 14.04 image
# Other settings have been omitted, the below changes are relevant
machine:
pre:
- sudo service postgresql stop
- sudo apt-get purge -y postgresql*
- sudo apt-get update
- sudo apt-get install postgresql
- sudo service postgresql start
- sudo su - postgres -c "echo \"create user ubuntu with password 'ubuntu';\" | psql"
- sudo su - postgres -c "echo \"alter user ubuntu with superuser;\" | psql"
@blixt
blixt / prng.js
Last active January 14, 2024 07:01
A very simple, seedable JavaScript PRNG. NOTE: Please read comments on why this is not a good choice.
// NOTICE 2020-04-18
// Please see the comments below about why this is not a great PRNG.
// Read summary by @bryc here:
// https://github.com/bryc/code/blob/master/jshash/PRNGs.md
// Have a look at js-arbit which uses Alea:
// https://github.com/blixt/js-arbit
/**
@buger
buger / gist:4327086
Created December 18, 2012 10:56
Migration from intercom.io to analytics.js

Migrating from intercom.io to analytics.js

Intercom.io use 2 level hash and separate user identification and user tracking. Analytics.js use plain hash to handle both identification and tracking. Below you can see migration scheme:

var intercomSettings = {                         analytics.initialize({
                                                    
  app_id: 'bk7tlzy4',                              'Intercom': 'bk7tlzy4'
                             
@spikebrehm
spikebrehm / modifierKey.js
Created September 19, 2012 02:50
Determine if a modifier key is pressed in JavaScript.
// modifierKey used to check if cmd+click, shift+click, etc.
!function($, global){
var $doc = $(document);
var keys;
global.modifierKey = false;
global.keys = keys = {
'UP': 38,
'DOWN': 40,