Skip to content

Instantly share code, notes, and snippets.

@kbrgl
kbrgl / translator.py
Created November 11, 2022 23:59
Repro for state bugs
"""Welcome to Pynecone! This file outlines the steps to create a basic app."""
# Import pynecone.
from datetime import datetime
import pcconfig
import pynecone as pc
from pynecone.base import Base
docs_url = "https://pynecone.io/docs/getting-started/introduction"
@kbrgl
kbrgl / bw.go
Created December 23, 2021 10:17
package main
import (
"fmt"
"image"
"log"
"os"
"path/filepath"
"strings"
@kbrgl
kbrgl / logger.py
Last active June 20, 2020 16:17
Zero-dependency Logger class for logging of table-structured data in Python.
class Logger:
"""Logger provides logging of table-structured data.
The first column provided must be interpretable as a title. You may provide
a 'formatting function' for each column that formats values corresponding
to that column.
>>> logger = Logger({
... 'Film Title': None,
... 'Running Time': lambda x: '{} hours'.format(round(x, 2)),
... 'Rating': lambda x: '⭐️' * x,
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
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
@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
@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 / 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:

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 / init.coffee
Created March 30, 2016 21:42
Atom small UI fix
require('web-frame').setZoomFactor(1.5)
# other coffee here