Skip to content

Instantly share code, notes, and snippets.

View bheesham's full-sized avatar
🦥
yes

Bheesham Persaud bheesham

🦥
yes
View GitHub Profile
@bheesham
bheesham / class_abstract.js
Last active February 1, 2023 05:54
A somewhat simple way to have abstract classes in JavaScript. There's probably a better way to do this.
// Define an abstract class
var Abstract = function() {};
Abstract.prototype.f1 = function() {
throw "Not implemented";
}
Abstract.prototype.f2 = Abstract.prototype.f3 = Abstract.prototype.f1;
// Implement our abstract class
var Class = Abstract;
Class.prototype.f1 = function() {
@bheesham
bheesham / swallo
Last active December 11, 2015 21:18
Count to 3, no more than 3, no less than 3, or count to two, if the proceeding number is 3.
Count to 3.
1
2
5
@bheesham
bheesham / gist:3621049
Created September 4, 2012 13:14
Test to see what online PHP testers do to escape this listing the files of the current directory.
function stev_al($str) {
$test = "eval";
$test($str);
}
echo stev_al(base64_decode("JGZpbGVzID0gZGlyKCcuLycpOw0Kd2hpbGUgKGZhbHNlICE9PSAoJGVudHJ5ID0gJGQtPnJlYWQoKSkpIHsNCiAgIGVjaG8gJGVudHJ5LiAiPGJyPiI7DQp9DQokZC0"));
@bheesham
bheesham / latest_version.py
Created August 12, 2012 04:25
Downloads the latest version of MineCraft.
"""
Downloads the latest snapshot of MineCraft
@version 1.0.0
@author Bheesham Persaud <http://bheesham.com/
@license Beerware <http://wikipedia.org/wiki/Beerware>
"""
import os
import requests
import re
@bheesham
bheesham / pybinclock.py
Created May 30, 2012 03:17
A clock that prints out the time in binary.
"""
Copyright (C) 2012 Bheesham Persaud.
pybinaryclock - A clock that prints out the time in binary.
pybinaryclock is Beerware <http://en.wikipedia.org/wiki/Beerware>.
Format: HHMMSS
Usage: python pybinclock.py
"""