Skip to content

Instantly share code, notes, and snippets.

View vivekagr's full-sized avatar

Vivek Agarwal vivekagr

View GitHub Profile
// ==UserScript==
// @name Amazon Add to Cart
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match *://www.amazon.in/*/dp/*
// @match *://www.amazon.in/dp/*
// @match *://www.amazon.in/gp/product*
// @grant none
{
"logs": [
{
"description": "Google 'Testtube' log",
"key": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEw8i8S7qiGEs9NXv0ZJFh6uuOmR2Q7dPprzk9XNNGkUXjzqx2SDvRfiwKYwBljfWujozHESVPQyydGaHhkaSz/g==",
"url": "ct.googleapis.com/testtube/",
"maximum_merge_delay": 86400,
"operated_by": [
0
]
### Keybase proof
I hereby claim:
* I am vivekagr on github.
* I am vivekagr (https://keybase.io/vivekagr) on keybase.
* I have a public key whose fingerprint is 4FA1 AE88 2283 2C82 BA99 3F46 3B29 18BA BEE9 8359
To claim this, I am signing this object:
@vivekagr
vivekagr / vim-on-heroku.sh
Created June 28, 2016 15:07 — forked from sfate/vim-on-heroku.sh
vim on heroku
#!/usr/bin/env bash
curl https://s3.amazonaws.com/heroku-jvm-buildpack-vi/vim-7.3.tar.gz --output vim.tar.gz
mkdir vim && tar xzvf vim.tar.gz -C vim
export PATH=$PATH:/app/vim/bin

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@vivekagr
vivekagr / test.conf
Created December 17, 2015 01:09
nginx config to go along with lang.lua
server {
listen 80 default_server;
root /home/ubuntu/test;
index index.html index.htm;
error_log /home/ubuntu/test/error.log;
access_log /home/ubuntu/test/access.log;
location / {
@vivekagr
vivekagr / nginx-lang.lua
Last active December 17, 2015 01:03 — forked from mauron85/nginx-lang.lua
Detect preferred language script for Nginx written in LUA
-------------------------------------------------------------------------------
-- HTTP Accept-Language header handler --
-- @originalAuthor: f.ghibellini@gmail.com --
-- @originalRepository: https://github.com/fghibellini/nginx-http-accept-lang--
-- @modifiedBy: marian.hello@mapilary.com --
-- @gist: https://gist.github.com/mauron85/47ed1075262d9e020fe2 --
-- @license: MIT --
-- @requires: --
-- @description: --
-- returns language with greatest quality --

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@vivekagr
vivekagr / router_stats.py
Last active December 14, 2015 06:19
Gathers and prints IP Address, WAN Status, SNR Margin, attenuation and transfer rate from ITI DNA-A211-I modem.
import sys
import re
from time import sleep
import requests
from requests.auth import HTTPBasicAuth
from bs4 import BeautifulSoup
from termcolor import colored
MAIN_PAGE_URL = "http://192.168.1.1/info.html"
@vivekagr
vivekagr / webpack.config.js
Created August 30, 2015 19:17
example webpack config
var webpack = require("webpack");
module.exports = {
entry: {
'respondent-connections': './surveyapp/static/js/respondent-connections/app.js'
},
output: {
path: './surveyapp/static/js/respondent-connections/',
filename: 'build.min.js'