Skip to content

Instantly share code, notes, and snippets.

Gone phishing

Kartik Talwar KartikTalwar

Gone phishing
View GitHub Profile
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
View app.config
%% -*- mode: erlang;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ft=erlang ts=4 sw=4 et
%% Riak Client APIs config
{riak_api, [
%% pb_backlog is the maximum length to which the queue of pending
%% connections may grow. If set, it must be an integer >= 0.
%% By default the value is 5. If you anticipate a huge number of
%% connections being initialised *simultaneously*, set this number
%% higher.
View vm.args
## Name of the riak node
-name riak@
## Cookie for distributed erlang. All nodes in the same cluster
## should use the same cookie or they will not be able to communicate.
-setcookie riak
## Heartbeat management; auto-restarts VM if it dies or becomes unresponsive
## (Disabled by default..use with caution!)
View ap.php
$key = ''; // enter your api key here
function getLocations($key)
$url = "$key&service=APLocations";
$get = file_get_contents($url);
View TheMatrix.html
<body style=margin:0><canvas id=q /><script>var q=document.getElementById('q'),s=window.screen,w=q.width=s.width,h=q.height=s.height,p=Array(256).join(1).split(''),c=q.getContext("2d"),m=Math,r=m.random;setInterval(function(){c.fillStyle="rgba(0,0,0,0.05)";c.fillRect(0,0,w,h);c.fillStyle="rgba(0,255,0,1)";,i){c.fillText(String.fromCharCode(m.floor(2720+r()*33)),i*10,v);v+=10;if(v>768+r()*10000)v=0;return v})},33)</script>
View gist:5080747
parser = argparse.ArgumentParser(description='Generic API')
parser.add_argument('--name', dest='name', help='full name')
parser.add_argument('--token', dest='fbtoken', help='firebase token')
args = parser.parse_args()
name =
firebase = args.fbtoken
fname, lname = name.split()
View packages.pp
package { 'Droplr':
source => '',
provider => 'compressed_app'
package { 'Alfred':
provider => 'compressed_app',
source => ''
KartikTalwar /
Last active Aug 1, 2018
GitHub CoderDojo - Intro to D3.js

Animations in JavaScript


Library that uses HTML, CSS and SVG to bring data to life.

Setting Up

View scheduledump.json
# Function recreating the functionality of float() and int() in Python.
# By Neil Fraser. Public Domain. 2012.
def myFloat(input = 0.0):
if type(input) != str:
if type(input) == bool:
return input and 1.0 or 0.0
if type(input) == float:
return input
if type(input) in (int, long):