Skip to content

Instantly share code, notes, and snippets.

Hay Kranen hay

Block or report user

Report or block hay

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
hay / gist:1351230
Created Nov 9, 2011
Enterprisify your Java Class Names!
View gist:1351230
<!doctype html>
body {
background: white;
text-align: center;
padding: 20px;
font-family: Georgia, serif;
hay /
Last active Dec 8, 2019
Hay's dev cheatsheet
# Converts a JSONL file generated with telegram-history-dump (1) to CSV
# Usage: python <path to json file> <path to output csv file>
# Example: python Bob.json Bob.csv
# 1:
from datetime import datetime
import unicodecsv as csv
import json, sys
def get_isodate(msg):
date = msg.get("date", None)
View resit-2b
View resit-2a
Welcome to the fake people database!
No people database yet
Make a choice:
1) Remove a person
2) Add a person
3) Quit the program
Make your choice: [1/2/3]: 2
Added Jane with phone number 52334
Saved the database with 1 people
There are 1 people in the database:
View resit-1
Hey, welcome to Number Guessr
Please state your name Hay
Welcome Hay! You'll have 5 tries to guess a number
The number will be between 1 and 100
You have 5 guesses remaining
What's your guess? 50
50 is not correct, the number is lower
You have 4 guesses remaining
What's your guess? 25
hay /
Created Nov 11, 2018
A pretty horrible Python script to fix the SQL errors in the Rijksmonumenten dump mentioned here:
#!/usr/bin/env python3
from tqdm import tqdm
from sys import argv, exit
from os.path import getsize
def fix_token(token):
if token == ",":
return "'',"
elif token == "(,":
return "('',"
hay /
Created Nov 6, 2010
Download all images in a category on Wikimedia Commons. Requires pywikipedia
# -*- coding: utf-8 -*-
# -cat:Images_from_Wiki_Loves_Monuments
import sys, os
# Set your path to pywikipedia here
import wikipedia, config, pagegenerators
import urllib2, codecs
hay / app.js
Last active Dec 16, 2016
Learn Javascript MVC: create a todo list using Stapes.js in less than 100 lines code (part 1) examples
View app.js
var TodosModel = Stapes.subclass();
var TodosView = Stapes.subclass({
constructor : function(model) {
var self = this;
this.$el = $("#inputform");
this.model = model
var $input = this.$el.find("input");
hay /
Last active Aug 30, 2016
Wikipedia statistics parser comparison
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class WMStats {
private static final String FILE_NAME = "pagecounts-20141029-230000";
You can’t perform that action at this time.