Skip to content

Instantly share code, notes, and snippets.

@leecrossley
leecrossley / shake.js
Last active December 28, 2021 10:56
Shake gesture detection in PhoneGap / Cordova
/*
THIS GIST IS OUT OF DATE AND NOT MONITORED
PLEASE SEE https://github.com/leecrossley/cordova-plugin-shake-detection
*/
var shake = (function () {
var shake = {},
watchId = null,
options = { frequency: 300 },
previousAcceleration = { x: null, y: null, z: null },
@m4dz
m4dz / README.md
Last active January 27, 2023 01:14
OS X Fresh (Re)Install

OS X ENV (re)Install

This is my personal guide to restore my configuration and setup my system for a fresh install. I use it and keep it updated frequently. Hope it will inspire you on your own way =].

Backup

Before a fresh reinstall, don't forget to backup many things. A regular ghost made with CarbonCopyCloner or Clonezilla is a good solution, but if you can't, you should save the following:

@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh