This file contains hidden or 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
{ | |
"name": "brand-tweet", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "Hitesh", | |
"license": "ISC", |
This file contains hidden or 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
var Twitter = require('twitter'); | |
var Sentiment = require('sentiment'); | |
var debug = require('debug')('stream'); | |
var request = require('request'); | |
var config = { | |
consumer_key: '<Please your tokens here>', | |
consumer_secret: '<Please your tokens here>', | |
access_token_key: '<Please your tokens here>', | |
access_token_secret: '<Please your tokens here>', | |
}; |
This file contains hidden or 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
"use strict"; | |
var AWS = require('aws-sdk'); | |
var https = require('https'); | |
var http = require('http'); | |
var keys = { | |
accessKeyId: 'development', | |
secretAccessKey: 'development', |
This file contains hidden or 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
'use strict'; | |
var Harness = require('./support'); | |
var post = Harness.definePostTable().as('postsss'); | |
var customerAlias = Harness.defineCustomerAliasTable(); | |
var user = Harness.defineUserTable(); | |
// Harness.test({ | |
// query: post.as('a').select(post.id.max()), |
This file contains hidden or 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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
This file contains hidden or 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
git diff origin/master > /tmp/patch.diff # replace origin/master with branch to compare with | |
# Move this patch file to new server via scp. | |
patch -p1 < /tmp/patch.diff # Assuming same location on remote machine. | |
# Or alternatively | |
# git apply -v /tmp/patch.diff |
This file contains hidden or 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
$> sudo apt-get install gdb | |
$> sudo su | |
$> gdb | |
(gdb) attach process_id # insert process id instead of process_id | |
(gdb) call putenv ("env_var_name=env_var_value") # Add environmental variable | |
(gdb) detach # detach with option y |
This file contains hidden or 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
sudo !! # Runs last command with sudo privilege | |
python -m SimpleHTTPServer # Starts a HTTP server aat 8000 port in current folder, Great tool to share files! |
This file contains hidden or 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
cat a b | sort | uniq > c # c is a union b | |
cat a b | sort | uniq -d > c # c is a intersect b | |
cat a b b | sort | uniq -u > c # c is set difference a - b |
This file contains hidden or 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
red=$(tput setaf 1) | |
green=$(tput setaf 2) | |
yellow=$(tput setaf 3) | |
blue=$(tput setaf 4) | |
bold=$(tput bold) | |
reset=$(tput sgr0) | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != 'nothing to commit (working directory clean)' ]] && echo $red || echo $green | |
} |
NewerOlder