Skip to content

Instantly share code, notes, and snippets.

View selvavalluvan's full-sized avatar

Selva Valluvan selvavalluvan

View GitHub Profile
{
"children": [{
"children": [{
"name": "Celebrities \u0026 Entertainment News",
"id": 184
}, {
"children": [{
"name": "Animated Films",
"id": 1104
}, {
@selvavalluvan
selvavalluvan / zshrc.txt
Last active May 14, 2017 03:18
zshrc config
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
#Plugin 'valloric/youcompleteme'
# Path to your oh-my-zsh installation.
export ZSH=/Users/selva/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@selvavalluvan
selvavalluvan / README.md
Last active April 27, 2017 17:11
React App from scratch
  • mkdir blort
  • cd blort
  • npm init -y
  • npm install --save react react-dom
  • npm install --save-dev webpack babel-core babel-loader babel-preset-es2015 babel-preset-react
  • touch .babelrc webpack.config.js
  • mkdir -p public
  • mkdir -p app
  • touch app/App.jsx
  • touch public/index.html
@selvavalluvan
selvavalluvan / dbsetup.sh
Last active April 11, 2017 23:45
Mysql setup script
#!/usr/bin/env bash
MYSQL=`which mysql`
DB_NAME="product"
DB_USER="quietly_product"
DB_PASSWORD=$(awk '$1 ~ /DB_PASSWORD/ {print $1 }' ./.env | sed "s/^DB_PASSWORD=\(.*\)$/\1/")
DB_ADMIN_USER="quietly_admin"
DB_ADMIN_PASSWORD=$(awk '$1 ~ /DB_ADMIN_PASSWORD/ {print $1 }' ./.env | sed "s/^DB_ADMIN_PASSWORD=\(.*\)$/\1/")
@selvavalluvan
selvavalluvan / README.md
Last active April 11, 2017 21:33
Install Phantomjs

Linux

wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2

Check the download url for new verion from Phantomjs site

tar -xvzf phantomjs-2.1.1-linux-x86_64.tar.bz2
@selvavalluvan
selvavalluvan / README.md
Last active April 11, 2017 21:10
Install REDIS on Ubuntu

sudo add-apt-repository ppa:chris-lea/redis-server

Press ENTER to accept the repository.

sudo apt-get update

sudo apt-get install redis-server

To check redis is running (use sudo if necessary)

systemctl status redis-server

<!DOCTYPE html>
<html>
<head>
<script
src="https://code.jquery.com/jquery-3.1.1.min.js"
integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js"></script>
@selvavalluvan
selvavalluvan / README.md
Created February 16, 2017 19:30
BABEL CLIENT COMMANDS

TO CONVERT ONE FILE

babel --presets es2015 script.js --out-file script-compiled.js

TO CONVERT FOLDER

babel --presets es2015 lib/test --out-dir lib/test1

Delete all migration files. Sometimes Migrations files are corrupted.
find . -path "*/migrations/*.py" -not -name "__init__.py" -delete
find . -path "*/migrations/*.pyc" -delete
Delete and recreate the database if the migration is falied before.
python manage.py makemigrations
python manage.py migrate
Now, delete the newly created migrations files too.