Skip to content

Instantly share code, notes, and snippets.

@Ranjanivraman
Ranjanivraman / phpini
Created July 13, 2019 17:08 — forked from nkgokul/phpini
Ubuntu php ini locations
/etc/php5/cli/php.ini is for the CLI PHP program, which you found by running php on the terminal.
/etc/php5/cgi/php.ini is for the php-cgi system which isn't specifically used in this setup.
/etc/php5/apache2/php.ini is for the PHP plugin used by Apache. This is the one you need to edit for changes to be applied for your Apache setup.
@Ranjanivraman
Ranjanivraman / .bashrc
Created July 13, 2019 17:06 — forked from nkgokul/.bashrc
Bash File to install on new servers
alias cd...="cd ../.."
alias cd....="cd ../../.."
alias cd.....="cd ../../../.."
alias chrome="open -a 'Google Chrome'"
alias emacs="emacs -nw"
var keepsHisWord;
keepsHisWord = true;
promise1 = new Promise(function(resolve, reject) {
if (keepsHisWord) {
resolve("The man likes to keep his word");
} else {
reject("The man doesnt want to keep his word");
}
});
console.log(promise1);
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@Ranjanivraman
Ranjanivraman / bash-cheatsheet.sh
Created September 22, 2017 11:48 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@Ranjanivraman
Ranjanivraman / optimizely-js-api-cheatsheet.js
Created September 22, 2017 11:47 — forked from LeCoupa/optimizely-js-api-cheatsheet.js
Optimizely Javascript API Cheatsheet
// Optimizely JavaScript API
// http://developers.optimizely.com/javascript/
// To opt a visitor out of Optimizely tracking
// http://www.example.com/page.html?optimizely_opt_out=true
// 1. API Function Calls
// http://developers.optimizely.com/javascript/#api-function-calls-2
@Ranjanivraman
Ranjanivraman / redis_cheatsheet.bash
Created September 22, 2017 11:47 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
@Ranjanivraman
Ranjanivraman / cli.docker.sh
Created September 22, 2017 11:46 — forked from LeCoupa/cli.docker.sh
Docker Cheatsheet + Tips & Tricks
docker build -t friendlyname . # Create image using this directory's Dockerfile
docker run -p 4000:80 friendlyname # Run "friendlyname" mapping port 4000 to 80
docker run -d -p 4000:80 friendlyname # Same thing, but in detached mode
docker exec -it [container-id] bash # Enter a running container
docker ps # See a list of all running containers
docker stop <hash> # Gracefully stop the specified container
docker ps -a # See a list of all containers, even the ones not running
docker kill <hash> # Force shutdown of the specified container
docker rm <hash> # Remove the specified container from this machine
docker rm $(docker ps -a -q) # Remove all containers from this machine
@Ranjanivraman
Ranjanivraman / .bash_profile
Created September 22, 2017 11:46
Things that can save you time when inside your terminale
# Loads NVM
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
# Extends default PATH
PATH=$PATH:/usr/local/sbin
# Defines aliases
alias storepilots='cd ~/Documents/Storepilots/'
alias storepilots_api='cd ~/Documents/Storepilots/storepilots_api/'
@Ranjanivraman
Ranjanivraman / gist:db1033cc0e5b556de6dc64a73fb969b4
Created December 8, 2016 14:47 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote