Skip to content

Instantly share code, notes, and snippets.

View kaustavha's full-sized avatar
:octocat:
:electron: :atom: :shipit: 🚀 🌟 🇮🇳 🇺🇸 🇨🇦 Ethereum fanboi

Kaustav Haldar kaustavha

:octocat:
:electron: :atom: :shipit: 🚀 🌟 🇮🇳 🇺🇸 🇨🇦 Ethereum fanboi
View GitHub Profile
@kaustavha
kaustavha / gitRepoDownloader
Created June 16, 2014 16:38
Script to download all of a users/orgs public git repos
###
# This is a script to clone all of a users repositories off of github
# You need the git cli installed and the node-github pkg (npm install github)
# CLI Usage Examples:
# coffee gitScraper.coffee user :username
# coffee gitScraper.coffee org :orgname
###
process = require 'process'
githubApi = require 'github'
{spawn} = require 'child_process'
@kaustavha
kaustavha / Lua get file perm octal
Created July 17, 2015 16:52
The lua(luvit) way of retrieving file permissions
--[[ data is returned from fs.stat call to desired file]]--
octalFilePerm[file] = bit.band(data.mode, tonumber('777', 8))
`luajit -bs timer.lua - | wc -c` to count raw bytes of bytecode
luajit -bl file.lua to list the bytecode
git config --local --add gc.auto 0
git checkout master
git pull
git checkout your_branch
git reset --soft commit_hash_before_your_changes //(can be found by doing git log)
git stash
git merge master --ff
git stash apply
git commit
git push -f origin your_branch
@kaustavha
kaustavha / runner.coffee
Last active August 29, 2015 14:27
generator runner
# This script, when placed inside the meteor-kitchen-examples root project folder
# Can be used to run all the examples and generate output for jade, coffee and plain from json and yaml
fs = require 'fs'
{spawn} = require 'child_process'
path = require 'path'
async = require 'async'
dir = fs.readdirSync(__dirname)
dir = dir.filter((e, i, a) -> if e.indexOf('.') is -1 then return e)
humandirs = dir.filter((e, i, a) -> if e.indexOf('human') isnt -1 then return e)
@kaustavha
kaustavha / linkedin_connect.js
Created October 8, 2015 04:25
linkedin_connect.js
setInterval(function() { var connectBtns = document.getElementsByClassName('bt-request-buffed'); for(var i =0; i < connectBtns.length; i++) { console.log(connectBtns[i].parentNode.children[0].children[1].children[0].children[0].textContent);connectBtns[i].click()}}, 500);

I.e. what you will need to do to run facebookarchive/scribe/scribe_cat Good luck mate.

On ubuntu 14.04 LTS

mkdir fbhell && cd fbhell
sudo apt-get install git

First we need folly

@kaustavha
kaustavha / keybase.md
Created January 8, 2016 22:33
keybase.md

Keybase proof

I hereby claim:

  • I am kaustavha on github.
  • I am kaustavha (https://keybase.io/kaustavha) on keybase.
  • I have a public key whose fingerprint is 477F 6368 DEA0 991E F063 F874 8C4D 36CC 74A3 EACB

To claim this, I am signing this object:

@kaustavha
kaustavha / Readme.md
Last active March 1, 2016 18:17
Using node to generate applescript for sending emails

This is an example of using nodejs to generate applescript for sending out emails.

node example.js

Will output the applescript to console. On a mac with microsoft outlook configured and applescript one can create an applescript file and run it. e.g.

osascript out.osascript

This will send an email that looks like email.txt

@kaustavha
kaustavha / README.md
Last active February 14, 2024 21:49
Nodejs kafka consumer benchmark

Kafka-node consumer benchmark

This code can be used to benchmark throughput for a kafka cluster. Args:

groupId -- (str) kafka consumer group id, default: bench
concurrency -- (int) Number of worker threads to spawn, defaults to number of cpus on current host
duration -- (int) How long to run the benchmark for, default: 20s
topic -- (str) the kafka topic to consume from, defaults to observations.json
zk -- (str) zookeeper url, defaults to localhost:2181