Skip to content

Instantly share code, notes, and snippets.

🚀
Gone phishing

Kartik Talwar KartikTalwar

🚀
Gone phishing
Block or report user

Report or block KartikTalwar

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 numi-crypto.js
// Crypto Expansion Pack - Numi.io
numi.addUnit({
"id": "wei",
"phrases": "wei, Wei",
"baseUnitId": "ETH",
"format": "Wei",
"ratio": 1e-18,
});
View google-apps-script-json-parser.gs
// 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 = [];
View groupByMulti.js
function groupBy(array, i) {
var groups = {};
array.forEach(function(o) {
var group = o[i];
groups[group] = groups[group] || [];
groups[group].push(o);
});
return groups
}
View keybase.md

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:

View Ethereum 101.md

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

View whiteboardCleaner.md

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

View gmail_contentscript.js
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 Dec 30, 2015
Make github repos sticky
View sticky-repos.py
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()
View coursewatcher.php
<?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)
{
@KartikTalwar
KartikTalwar / RPMpackages.rb
Last active Jun 29, 2016
Create puppet facts for RPM packages
View RPMpackages.rb
package_data = Facter::Util::Resolution.exec('rpm --query --all --qf "%{NAME}||%{VERSION}\n"')
package_data.split("\n").each do |line|
rpm_detail = line.split("||")
package_name = 'package_' + rpm_detail[0]
package_version = rpm_detail[1]
Facter.add(package_name) do
setcode do
You can’t perform that action at this time.