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 / 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
"""
@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 / 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 / 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 / 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 / tas
Created April 7, 2014 23:00
Highlights tabs (red, 8 spaces) and spaces (green)
#!/usr/bin/env python3
__author__ = 'Bheesham Persaud <bheesham.persaud@live.ca>'
__license__ = 'ISC License'
__copyright__ = 'Copyright (C) 2014 Bheesham Persaud.'
__version__ = '0.0.1'
__usage__ = """tas <input file>
highlights tabs and spaces
"""
@bheesham
bheesham / gist:67876f928dc81328b1fb
Created February 12, 2015 04:16
Magic Realm Tile Data
[
{
"numbers": {
"1": {
"y": 156,
"x": 138
},
"2": {
"y": 281,
"x": 135
@bheesham
bheesham / Makefile
Last active December 5, 2015 02:22
Makefile for my LaTeX projects.
.PHONY: clean spell count
SOURCE=template.tex
# template.bib, graphics, etc.
ADDITIONAL=
NAME=$(patsubst %.tex,%,$(SOURCE))
OUTPUT=$(patsubst %.tex,%.pdf,$(SOURCE))

Keybase proof

I hereby claim:

  • I am bheesham on github.
  • I am bheesham (https://keybase.io/bheesham) on keybase.
  • I have a public key whose fingerprint is 4941 2C2A 783E 30B2 DE84 D2ED 3361 7817 D589 CB73

To claim this, I am signing this object:

;; -*- mode: emacs-lisp -*-
;; vim: set filetype=cl :
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default