Skip to content

Instantly share code, notes, and snippets.

@kbrgl
kbrgl / cryptic.bf
Created January 25, 2016 12:41
hint: repl.it
++++++++[>+>++>+++>++++>+++++>++++++>+++++++>++++++++>+++++++++>++++++++++>+++++++++++>++++++++++++>+++++++++++++>++++++++++++++>+++++++++++++++>++++++++++++++++<<<<<<<<<<<<<<<<-]>>>>>>>>>>>>>.<<<<<<<<<<<<<>>>>>>>>>>>>>>>----.++++<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>----.++++<<<<<<<<<<<<<<<>>>>>>>>>>>>>>.<<<<<<<<<<<<<<>>>>>>>>>>>>>>+++.---<<<<<<<<<<<<<<>>>>>>>++.--<<<<<<<>>>>>>-.+<<<<<<>>>>>>-.+<<<<<<>>>>>>>>>>>>>>>-.+<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>-.+<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>-.+<<<<<<<<<<<<<<<>>>>>>--.++<<<<<<>>>>>>>>>>>>>>>+.-<<<<<<<<<<<<<<<>>>>>>>>>>>>>>-.+<<<<<<<<<<<<<<>>>>>>>>>>>>>>>---.+++<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>----.++++<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>---.+++<<<<<<<<<<<<<<<>>>>>>>>>>>>++.--<<<<<<<<<<<<>>>>>>>>>>>>>---.+++<<<<<<<<<<<<<>>>>>>--.++<<<<<<>>>>>>>>>>>>+++.---<<<<<<<<<<<<>>>>>>>>>>>>>>-.+<<<<<<<<<<<<<<>>>>>>>>>>>>>>---.+++<<<<<<<<<<<<<<>>>>>>-.+<<<<<<>>>>>>>>>>>>>>>-.+<<<<<<<<<<<<<<<>>>>>>>>>>>>+.-<<<<<<<<<<<<>>>>>>>>>>>>>>>----.++++<<<<<<<<<<<<<<<>>>>>>>>>>>>+++.---<<<<<<<<<<<<>>>>>>>>>>>>>
@kbrgl
kbrgl / kit.sh
Last active April 9, 2016 07:29
Kabir's Installation Tool
#!/bin/bash
# Elevate priviliges
sudo echo "Welcome to Kabir's Installation Tool."
echo "At any point during the installation, you can enter 'e' as your answer to exit."
echo
# Ask user whether they want to install a given program
function yn {
while true; do
@kbrgl
kbrgl / template.js
Created March 14, 2016 04:18
Simplistic node templates
'use strict';
const render = function(template, mappings) {
for (let mapping in mappings) {
template = template.replace(new RegExp(`\\{\\{\\s?${mapping}\\s?\\}\\}`, 'g'), function (capture) {
if (typeof mappings[mapping] === 'function') {
return mappings[mapping]();
} else {
return mappings[mapping];
}
@kbrgl
kbrgl / init.coffee
Created March 30, 2016 21:42
Atom small UI fix
require('web-frame').setZoomFactor(1.5)
# other coffee here
fn input() -> io::Result<String> {
let mut string = String::new();
let bytes_read = try!(io::stdin().read_line(&mut string));
if bytes_read == 0 {
return Err(io::Error::new(io::ErrorKind::Other,
"The line could not be read."));
}
@kbrgl
kbrgl / keybase.md
Created March 25, 2017 06:24
GitHub proof

Keybase proof

I hereby claim:

  • I am kbrgl on github.
  • I am kabir (https://keybase.io/kabir) on keybase.
  • I have a public key ASABq0p3IGoLT2Jk0car1VvxpPmHYR-ck4djzXtShXsZngo

To claim this, I am signing this object:

@kbrgl
kbrgl / imfib.py
Created July 24, 2017 07:49
Program to create an image with pixels corresponding to the Fibonacci series
"""
Program to create an image with pixels corresponding to the Fibonacci series.
(c) 2017 Kabir Goel
Licensed under the terms of the MIT license.
"""
import sys
import argparse
try:
from PIL import Image
except ImportError:
@kbrgl
kbrgl / aylien.js
Created July 17, 2019 06:39
Aylien wrapper
const bluebird = require('bluebird')
const AylienNewsApi = require('aylien-news-api')
const api = new AylienNewsApi.DefaultApi()
bluebird.promisifyAll(api)
// Configure API authorization
const { app_id: appId, app_key: appKey } = api.apiClient.authentications
appId.apiKey = process.env.AYLIEN_APP_ID
This file has been truncated, but you can view the full file.
Ph Array
12345 4
43464000 7.254 6.284
43465000 7.760 4.791
43466000 5.999 6.153
43467000 6.533 5.923
43468000 6.659 6.566
43469000 5.991 6.150
43470000 7.604 6.953
This file has been truncated, but you can view the full file.
{
"ph": [[43464000,7.254,6.284],[43465000,7.76,4.791],[43466000,5.999,6.153],[43467000,6.533,5.923],[43468000,6.659,6.566],[43469000,5.991,6.15],[43470000,7.604,6.953],[43471000,5.688,6.285],[43472000,7.783,5.599],[43473000,5.581,6.919],[43474000,6.871,6.505],[43475000,5.569,5.752],[43476000,7.282,6.714],[43477000,6.776,5.981],[43478000,6.559,5.539],[43479000,5.942,7.28],[43480000,7.241,6.155],[43481000,6.703,5.469],[43482000,5.981,6.738],[43483000,6.168,6.327],[43484000,6.659,6.609],[43485000,6.85,7.033],[43486000,5.612,5.037],[43487000,7.521,5.431],[43488000,7.06,5.986],[43489000,6.643,5.534],[43490000,6.67,5.834],[43491000,6.494,6.287],[43492000,6.443,5.866],[43493000,6.599,5.52],[43494000,6.676,6.214],[43495000,6.52,5.497],[43496000,7.01,5.96],[43497000,6.09,6.118],[43498000,6.906,5.913],[43499000,6.233,6.505],[43500000,5.856,6.313],[43501000,6.878,6.191],[43502000,7.261,4.994],[43503000,6.691,6.27],[43504000,7.012,5.951],[43505000,5.588,5.959],[43506000,6.446,6.633],[43507000,7.809,7.084],[43508000,7.0