Skip to content

Instantly share code, notes, and snippets.

View kaushik94's full-sized avatar
🎉
Partying

Kaushik Varanasi kaushik94

🎉
Partying
View GitHub Profile
@kaushik94
kaushik94 / .mongorc.js
Created March 20, 2018 20:06 — forked from yanatan16/.mongorc.js
My .mongorc.js file
(function () {
rcversion = '1.0';
load('underscore.min.js')
// NOTES
// Basics, wrap the whole thing in a function
// Set a version for sanity's sake
// Load underscore, a must in any javascript environment
@kaushik94
kaushik94 / git-deployment.md
Created March 5, 2018 23:28 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your lokal GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like my Deepl.io to act upon a Web-Hook that's triggered that service.

__author__ = 'kvaranasi'
import csv
import os
import re
rootdir = os.getcwd()
rootdir += '/lib/fathead'
for subdir, dirs, files in os.walk(rootdir):
for file in files:
@kaushik94
kaushik94 / file2.txt
Created May 20, 2016 08:20
the description for this gist
String file contents
@kaushik94
kaushik94 / file1.txt
Created May 20, 2016 08:07
the description for this gist
String file contents
@kaushik94
kaushik94 / git_essentials.txt
Last active March 30, 2016 00:16
git essentials
# This will destroy any local modifications.
# Don't do it if you have uncommitted work you want to keep.
git reset --hard 0d1d7fc32
# Alternatively, if there's work to keep:
git stash
git reset --hard 0d1d7fc32
git stash pop
# This saves the modifications, then reapplies that patch after resetting.
# You could get merge conflicts, if you've modified things which were
#!/usr/bin/env python2.7
from __future__ import print_function
import commands
import os
import stat
from gitlab import Gitlab
def get_clone_commands(token, repo_root):
con = Gitlab("http://gitlab.your.domain", token)
# Fork your repo example, the following is link to mine
https://github.com/kaushik94/privacybadgerchrome
# On your terminal
git clone https://github.com/kaushik94/privacybadgerchrome
# Install and run tests, then checkout another branch
# and name it in a way that resonates with the issue being solved
git checkout -b <new-branch-name-withou-these-brackets>
@kaushik94
kaushik94 / .bash_profile.sh
Created November 14, 2015 11:01
Make an alias in Bash shell in OSX terminal
# At the end of this file
alias <new-alias-without-quotes>='<existing-command-in-quotes>'
@kaushik94
kaushik94 / dejavu
Last active October 5, 2015 06:21
dejaVu
## The idea
The idea was to have a frontend for a streaming data of json documents and a way to notify of any updates/deletes. So technically we want the browser to do just one thing - update the frontend as new document comes in or if something changes and we wanted it to be good at just that.
## React ? Seriously ?
We chose react to build this since it deals well with one thing in particular - How to update the DOM from state A to state B in the most optimal way(less read/writes). You can control the DOM without exactly telling how to reach there, but just by telling what it should look like in an object-oriented fashion. Plus its a perfect library for frontend. Other options like angular and JQuery fall into the category of frameworks which let you manipulate the DOM "easily". This is sometimes bad since we just want the template to render the data in a particular fashion once we let it know what the data is. Refer to "Why so much code?" section for more detail.
## Ohh but ..
Note : that I am not talking