Skip to content

Instantly share code, notes, and snippets.

🌦
to stderr is human

Karan Goel karan

🌦
to stderr is human
Block or report user

Report or block karan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View CoinDenomination.java
public class CoinDenomination {
PENNY(1), NICKLE(5), DIME(10), QUARTER(25);
private int value;
CoinDenomination(int v) {
value = v;
}
View CoinDenomination.java
public class CoinDenomination {
private int value;
// So no one else can instantiate
private CoinDenomination(int v) {}
public static final CoinDenomination PENNY = new CoinDenomination(1);
public static final CoinDenomination NICKLE = new CoinDenomination(5);
public static final CoinDenomination DIME = new CoinDenomination(10);
View index.html
<html>
<head>
<script src="https://code.jquery.com/jquery-2.2.2.min.js"></script>
</head>
<body>
<a class="btn btn-primary" id="agree_to_tos">Accept Terms of Service</a>
</body>
</html>
View tweetdeck_paste_image.js
document.getElementsByClassName('compose-text-container')[0].onpaste = function (event) {
var items = (event.clipboardData || event.originalEvent.clipboardData).items;
// find pasted image among pasted items
var blob;
for (var i = 0; i < items.length; i++) {
if (items[i].type.indexOf("image") === 0) {
blob = items[i].getAsFile();
}
}
View api_keys.go
package main
const (
BigHugeLabsApiKey = "3f1b2e0a6b4f83952ad128a9f5262ee4"
WordnikApiKey = "d0c4d5535e0070ddec00b0d55bf04b5f5f25566a40c2a0552"
)
View gist:6f52f2425abffa30323b
Verifying that +goel is my openname (Bitcoin username). https://onename.com/goel
View nginx.conf
user nginx;
worker_processes 4;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
# max_clients = worker_processes * worker_connections / 4
worker_connections 1024;
}
View gist:1f1fe59e4f047f8d888e
# rename origin remote
git remote rename origin github
# add the gitlab remote (for the love of everything that’s holy, use ssh)
git remote add bitbucket <remote link for bitbucket>
# push existing code to new remote
git push -u bitbucket —all
# let’s magic
@karan
karan / provision_ec2.sh
Last active Aug 29, 2015
Script to provision an EC2 instance for any node application
View provision_ec2.sh
# update linux
sudo apt-get update
# install gcc and git
sudo apt-get install gcc-c++ make
sudo apt-get install openssl-devel
sudo apt-get install git
# install node and npm
curl -sL https://deb.nodesource.com/setup | sudo bash -
View keybase.md

Keybase proof

I hereby claim:

  • I am karan on github.
  • I am karan (https://keybase.io/karan) on keybase.
  • I have a public key whose fingerprint is BB34 05A3 64A6 0AC0 B6DF B018 6641 2ED7 B664 1B3C

To claim this, I am signing this object:

You can’t perform that action at this time.