Skip to content

Instantly share code, notes, and snippets.

View dcyou's full-sized avatar

David Turbert dcyou

View GitHub Profile
@dcyou
dcyou / meteor.sh
Last active August 29, 2015 14:15 — forked from gabrielhpugliese/meteor.sh
#!/bin/bash
sudo apt-get update
sudo apt-get install python-software-properties
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" | sudo tee -a /etc/apt/sources.list.d/10gen.list
sudo apt-get update
sudo apt-get install -y git mongodb-10gen curl
cd /usr/local
wget http://nodejs.org/dist/v0.8.23/node-v0.8.23-linux-x86.tar.gz
sudo tar -xvzf node-v0.8.23-linux-x86.tar.gz --strip=1
@dcyou
dcyou / gist:fad3c4c4e21c3561e985
Created December 2, 2015 12:52 — forked from ivan-loh/gist:ee0d96c3795e59244063
Node.JS ( & pm2 ) Process Memory Limit
# Plain Ol' Node
node --max-old-space-size=1024 app.js # increase to 1gb
node --max-old-space-size=2048 app.js # increase to 2gb
node --max-old-space-size=3072 app.js # increase to 3gb
node --max-old-space-size=4096 app.js # increase to 4gb
node --max-old-space-size=5120 app.js # increase to 5gb
node --max-old-space-size=6144 app.js # increase to 6gb
# For pm2
pm2 start app.js --node-args="--max-old-space-size=1024" # increase to 1gb
OIFS=$IFS;
IFS=",";
# fill in your details here
dbname=DBNAME
user=USERNAME
pass=PASSWORD
host=HOSTNAME:PORT
# first get all collections in the database
@dcyou
dcyou / git-setup.sh
Created April 29, 2016 14:15 — forked from patik/git-setup.sh
Git and Node with Zscaler proxy
#!/bin/sh
# Git proxy settings
echo "Configuring Git..."
git config --global http.proxy http://gateway.zscaler.net:80/
git config --system http.proxy http://gateway.zscaler.net:80/
git config --global http.sslVerify false
git config --system http.sslVerify false
git config --global --unset http.sslcainfo
git config --system --unset http.sslcainfo
@dcyou
dcyou / gist:6c1ee3d704e50e1f424aa308bdf583c3
Created September 5, 2017 06:29 — forked from yuristrelets/gist:d88abca500199cff1b50
Get selected record in ExtJS 4.2.1
getSelectedRecord: function() {
var grid = this.getGrid(),
records = grid.getSelectionModel().getSelection(),
record;
if(records.length) {
// get first record from selection
record = records[0];
// find selection record in store
@dcyou
dcyou / npm-using-https-for-git.sh
Created October 11, 2017 11:02 — forked from taoyuan/npm-using-https-for-git.sh
Force git to use https:// instead of git://
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
@dcyou
dcyou / install-gcc-4.9.3.sh
Created November 29, 2017 15:28 — forked from jtilly/install-gcc-4.9.3.sh
Install GCC 4.9.3
#!/bin/bash
# this script installs GCC 4.9.3
# to use it navigate to your home directory and type:
# sh install-gcc-4.9.3.sh
# download and install gcc 4.9.3
wget https://ftp.gnu.org/gnu/gcc/gcc-4.9.3/gcc-4.9.3.tar.gz
tar xzf gcc-4.9.3.tar.gz
cd gcc-4.9.3
@dcyou
dcyou / Pi.md
Last active February 5, 2019 14:48 — forked from jgamblin/Pi.txt
PoisonTap Install Commands

Server:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
@dcyou
dcyou / .bash_profile
Last active May 1, 2020 08:54 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@dcyou
dcyou / Response.php
Created June 3, 2020 05:30 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;