Skip to content

Instantly share code, notes, and snippets.

View bob2314's full-sized avatar
:octocat:
Code...

Bob bob2314

:octocat:
Code...
View GitHub Profile
@bob2314
bob2314 / create.sh
Last active October 13, 2017 07:23
Installs Node JS & NVM - Test driven on Ubuntu 16
#!/usr/bin/env bash
##
## Usage: ./create.sh <node version> "if params are left blank, defaults to 8.7.0"
##
## Typical: ./create.sh 8.7.0
##
##
echo "Installing ALL THE THINGS!!! \n"
@bob2314
bob2314 / colors.js
Created July 17, 2017 21:24
Making colors in the terminal
#!/usr/bin/env node
var css = "text-shadow: -1px -1px hsl(0,100%,50%), 1px 1px hsl(5.4, 100%, 50%), 3px 2px hsl(10.8, 100%, 50%), 5px 3px hsl(16.2, 100%, 50%), 7px 4px hsl(21.6, 100%, 50%), 9px 5px hsl(27, 100%, 50%), 11px 6px hsl(32.4, 100%, 50%), 13px 7px hsl(37.8, 100%, 50%), 14px 8px hsl(43.2, 100%, 50%), 16px 9px hsl(48.6, 100%, 50%), 18px 10px hsl(54, 100%, 50%), 20px 11px hsl(59.4, 100%, 50%), 22px 12px hsl(64.8, 100%, 50%), 23px 13px hsl(70.2, 100%, 50%), 25px 14px hsl(75.6, 100%, 50%), 27px 15px hsl(81, 100%, 50%), 28px 16px hsl(86.4, 100%, 50%), 30px 17px hsl(91.8, 100%, 50%), 32px 18px hsl(97.2, 100%, 50%), 33px 19px hsl(102.6, 100%, 50%), 35px 20px hsl(108, 100%, 50%), 36px 21px hsl(113.4, 100%, 50%), 38px 22px hsl(118.8, 100%, 50%), 39px 23px hsl(124.2, 100%, 50%), 41px 24px hsl(129.6, 100%, 50%), 42px 25px hsl(135, 100%, 50%), 43px 26px hsl(140.4, 100%, 50%), 45px 27px hsl(145.8, 100%, 50%), 46px 28px hsl(151.2, 100%, 50%), 47px 29px hsl(156.6, 100%, 50%), 48px 30px hsl(162, 100%, 50%), 49px 31p
#!/usr/bin/env bash
echo "Installing ALL THE THINGS!!! \n"
echo "Node, & NVM - it's happening! \n"
if which node > /dev/null
then
# add deb.nodesource repo commands
# install node
@bob2314
bob2314 / gist:36554409d6706736a4b4dc07b7514388
Created July 5, 2017 03:57 — forked from nicferrier/gist:2277987
Clone a git repo if it does not exist, or pull into it if it does exist
#!/bin/sh
REPOSRC=$1
LOCALREPO=$2
# We do it this way so that we can abstract if from just git later on
LOCALREPO_VC_DIR=$LOCALREPO/.git
if [ ! -d $LOCALREPO_VC_DIR ]
then
#!/bin/bash
# Predefined links and files. Note: LTS may not be latest LTS
export NODE_STABLE=http://nodejs.org/dist/node-latest.tar.gz
export NODE_LTS=https://nodejs.org/dist/latest-v4.x/node-v4.2.2.tar.gz
export RC_BASH=~/.bashrc
export RC_PROFILE=~/.profile
# Settings
export NODE_VER=$NODE_LTS
@bob2314
bob2314 / deploy.rb
Created April 8, 2017 05:11 — forked from evantahler/deploy.rb
deploy.rb for node apps
set :application, "MY_APPLICATION"
set :repository, "git@github.com:PATH_TO_MY_REPO"
set :scm, :git
set :use_sudo, false
set :keep_releases, 5
set :deploy_via, :remote_cache
set :main_js, "MAIN_APP.js"
desc "Setup the Demo Env"
task :demo do
BOX_NAME=vagrant-build
BASE_DIR="`pwd`/machines"
BOX_DIR="${BASE_DIR}/${BOX_NAME}"
mkdir -p ${BASE_DIR}
VBoxManage createvm --name "${BOX_NAME}" --ostype RedHat_64 --basefolder ${BASE_DIR}
VBoxManage registervm "${BOX_DIR}/${BOX_NAME}.vbox"
mkdir -p tmp
@bob2314
bob2314 / node-and-npm-in-30-seconds.sh
Created December 8, 2016 19:38 — forked from isaacs/node-and-npm-in-30-seconds.sh
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
@bob2314
bob2314 / existsSync.js
Created November 6, 2016 10:13 — forked from FGRibreau/existsSync.js
existsSync - Check if a file exist in NodeJS
/*
fileExistSync - Check if a file exist in NodeJS
Twitter: @FGRibreau / fgribreau.com
Usage:
var fileExistSync = require('./fileExistSync');
var exist = fileExistSync('/var/folders/zm/jmjb49l172g6g/T/65b199');
Support for Nodev0.6