This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Swap keys with values of a javascript object | |
const swapKV = (object) => { | |
const ret = {}; | |
for (let key in object) { | |
if (object.hasOwnProperty(key)) { | |
ret[object[key]] = key; | |
} | |
} | |
return ret; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
npm install -g grunt grunt-cli bower yo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "centos64" | |
config.vm.box_url = "http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.5-x86_64-v20140110.box" | |
config.vm.network :private_network, ip: "192.168.50.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "LC_ALL=C" >> /etc/environment | |
yum -y install git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat << 'EOF' >> .bash_profile | |
if [ -n "$SSH_CLIENT" ]; then | |
PS1='\[\033[01;33m\]\u\033[00m\]@\[\033[01;33m\]\h\[\033[00m\]:\[\033[00;33m\]\w\[\033[00m\] ' | |
fi | |
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cat << 'EOF' >> /etc/yum.repos.d/mongodb.repo | |
[mongodb] | |
name=MongoDB Repository | |
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/ | |
gpgcheck=0 | |
enabled=1 | |
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat << 'EOF' >> ~/.npmrc | |
root = $HOME/.local/lib/node_modules | |
binroot = $HOME/.local/bin | |
manroot = $HOME/.local/share/man | |
EOF | |
mkdir -p ~/.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while [ "$1" != "" ]; do | |
echo $1 | |
shift | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
script="myscript" | |
#Declare the number of mandatory args | |
margs=2 | |
# Common functions - BEGIN | |
function example { | |
echo -e "example: $script -m0 VAL -m1 VAL -o1 -o2 VAL" | |
} |
NewerOlder