Skip to content

Instantly share code, notes, and snippets.

View rodleviton's full-sized avatar
⛰️

Rodney Leviton rodleviton

⛰️
View GitHub Profile
@rodleviton
rodleviton / imagemagick-install-steps
Created May 26, 2014 07:37
Installing Image Magick on Ubuntu 14.04
sudo -i
cd
apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y
wget http://www.imagemagick.org/download/ImageMagick-6.8.7-7.tar.gz
tar xzvf ImageMagick-6.8.9-1.tar.gz
cd ImageMagick-6.8.9-1/
./configure --prefix=/opt/imagemagick-6.8 && make
checkinstall
@rodleviton
rodleviton / simulateTyping.js
Created July 17, 2021 10:33 — forked from rik/simulateTyping.js
Fake typing animation with async/await
async function nextFrame() {
return new Promise((resolve) => {
requestAnimationFrame(resolve)
})
}
async function randomDelay(min, max) {
const delay = Math.random() * (max - min) + min;
const startTime = performance.now()
while (performance.now() - startTime < delay) {
@rodleviton
rodleviton / install.sh
Last active January 20, 2018 12:59 — forked from JeffreyWay/install.sh
cd /vagrant
mkdir html
sudo apt-get update
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
sudo apt-get install -y vim curl python-software-properties
sudo add-apt-repository -y ppa:ondrej/php5
sudo apt-get update
sudo apt-get install -y php5 apache2 libapache2-mod-php5 php5-curl php5-gd php5-mcrypt php5-readline mysql-server-5.5 php5-mysql git-core php5-xdebug
cat << EOF | sudo tee -a /etc/php5/mods-available/xdebug.ini
@rodleviton
rodleviton / mongo-autostart-osx.md
Created March 7, 2017 10:43 — forked from subfuzion/mongo-autostart-osx.md
mongo auto start on OS X

Install with Homebrew

brew install mongodb

Set up launchctl to auto start mongod

$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

/usr/local/opt/mongodb/ is a symlink to /usr/local/Cellar/mongodb/x.y.z (e.g., 2.4.9)

@rodleviton
rodleviton / .jshintrc.js
Created July 12, 2016 11:11 — forked from connor/.jshintrc.js
jshintrc example
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.

Delete Git local branch

git branch -D branch_name

NPM specific release version from Github

git+ssh://git@github.com:rodleviton/module.git#v1.0.0

Rebase to master

@rodleviton
rodleviton / gist:7076764
Created October 20, 2013 23:50
JavaScript: jQuery Extend Plugin
$.extend($.fn.pluginName, {
// Override methods here
};
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
@rodleviton
rodleviton / npm-sudo-fix
Last active August 29, 2015 14:09
NPM Sudo Fix
# You need to reclaim ownership of the .npm directory
sudo chown -R <username> ~/.npm
# And need the write permission in node_modules directory
sudo chown -R <username> /usr/local/lib/node_modules
@rodleviton
rodleviton / node-upgrade-osx
Created August 28, 2014 02:26
Node upgrade OSX
sudo npm cache clean -f
sudo npm install -g n
sudo n stable