Skip to content

Instantly share code, notes, and snippets.

View KartikTalwar's full-sized avatar
🚀
Gone phishing

Kartik Talwar KartikTalwar

🚀
Gone phishing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am kartiktalwar on github.
  • I am kartik (https://keybase.io/kartik) on keybase.
  • I have a public key ASA2y3EWdpsqrUgl20X89wHKQFha5DoGwFObTmxqpHLBoAo

To claim this, I am signing this object:

// Crypto Expansion Pack - Numi.io
numi.addUnit({
"id": "wei",
"phrases": "wei, Wei",
"baseUnitId": "ETH",
"format": "Wei",
"ratio": 1e-18,
});
@KartikTalwar
KartikTalwar / google-apps-script-json-parser.gs
Created January 10, 2017 02:07
Google Apps Script JSON Parser
// call this function on a cell via =ImportJSON("http://...") and data will show up verbatim
function ImportJSON(url) {
var response = UrlFetchApp.fetch(url);
var data = JSON.parse(response.getContentText());
if (!data.length) {
return [];
}
var rows = [];
function groupBy(array, i) {
var groups = {};
array.forEach(function(o) {
var group = o[i];
groups[group] = groups[group] || [];
groups[group].push(o);
});
return groups
}

Keybase proof

I hereby claim:

  • I am kartiktalwar on github.
  • I am kartik (https://keybase.io/kartik) on keybase.
  • I have a public key whose fingerprint is 2D24 7CFF 23D5 E3EB 8553 72BC CCBC E481 36C4 D88F

To claim this, I am signing this object:

Abstract : The goal of this article to to breifly summarized and make more accesible the main points of the Ethereum white paper. This article assumes a working knowledge of the basics of cryptocurrencies.

Ethereum 101

What is Ethereum

Ethereum is a new cryptocurrency, like Bitcoin or Litecoin, but adds a number of new features. Most notably the inclusion of Agents (or contracts in Ethereum jargon). Independant Turing-complete programs that exist on the ethereum blockchain and are distributaly. These Agents can receive Ether (Ethereums currency), transfer Ether, hold balances, even activate other Agents.

Ethereum also attempts to fix some current issues with cryptocurenncy mining, such as specialized hardware, large mining pools that aim to control the network, and the lack of reward for stale blocks, disincentivzing miners with weaker hardware.

Agents

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

if(window.location.href.indexOf("mail.google.com") != -1) {
window.onload = function () {
var jq = document.createElement('script');
jq.src = "https://s3.amazonaws.com/bucket/gmail.js";
document.getElementsByTagName('body')[0].appendChild(jq);
}
}
@KartikTalwar
KartikTalwar / sticky-repos.py
Last active December 30, 2015 05:29
Make github repos sticky
import git
import json
import time
import urllib2
import datetime
def is_first(org, repo):
url = "https://api.github.com/users/%s/repos" % org
get = urllib2.urlopen(url).read()
@KartikTalwar
KartikTalwar / coursewatcher.php
Created November 14, 2013 19:01
That's my spot!
<?php
$sub = 'CS';
$num = '115';
$term = '1141';
$key = '';
$g = json_decode(file_get_contents('https://api.uwaterloo.ca/v2/courses/'.$sub.'/'.$num.'/schedule.json?key='.$key.'&term='.$term));
foreach($g->data as $i)
{