Skip to content

Instantly share code, notes, and snippets.

View foxx's full-sized avatar

Cal Leeming foxx

View GitHub Profile
import os
import sys
# temp assign
_files = {}
import binascii
import random
from pprint import pprint as p
CHOICES = ['G', 'G', 'G', 'G', 'B', 'B']
ANSWERS = [
'BGBBB',
'GBGBBB',
'GBBBBB'
]
@foxx
foxx / test.py
Last active August 29, 2015 14:01
Stopwatch Calculator
"""
A stopwatch records lap times as strings of the form "MM:SS:HS"
MM = minutes; SS = seconds; and HS = hundredths of a second.
Write a function that accepts two lap times and calculates their average,
returning the result in the same string format.
Input: "00:02:20" and "00:04:40"
Output: "00:03:30"
#!/usr/bin/env python
import re
import datetime
import smtplib
import itertools
from email.mime.text import MIMEText
class ScanAuthLog(object):
"""
@foxx
foxx / browserify-rce.py
Last active August 29, 2015 14:04
Browserify RCE Vulnerability (<= 4.2.0)
#!/usr/bin/python
"""
Browserify POC exploit
http://iops.io/blog/browserify-rce-vulnerability/
To run, just do:
$ python poc.py > exploit.js
@foxx
foxx / jquery.togglr.js
Created December 1, 2014 19:27
Element toggle for jQuery
(function (factory) {
// loader from https://github.com/umdjs/umd/blob/master/jqueryPlugin.js
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
@foxx
foxx / gist:77856da964cc986ab3ee
Last active August 29, 2015 14:12
keybase.md
### Keybase proof
I hereby claim:
* I am foxx on github.
* I am sleepycal (https://keybase.io/sleepycal) on keybase.
* I have a public key whose fingerprint is 3352 5EE5 1000 1772 5033 7A4D BA90 2A3F 2D9B E20B
To claim this, I am signing this object:
@foxx
foxx / gist:17a951750d4d7264b983
Created January 27, 2015 11:01
The Conscience of a Hacker
==Phrack Inc.==
Volume One, Issue 7, Phile 3 of 10
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following was written shortly after my arrest...
\/\The Conscience of a Hacker/\/
by
(function() {
var fs = require('fs');
var path = require('path');
var current_dir = path.dirname(fs.realpathSync(__filename));
var design_docs_dir = path.join(current_dir, 'design_docs');
var files = fs.readdirSync(design_docs_dir);
var json = {};
files.forEach(function(fpath) {
<!-- BEM EXAMPLE -->
<style>
.btn { display: block; color: red; }
.btn--orange { color: orange; }
</style>
<div class="btn btn--orange"></div>
<!-- NON-BEM EXAMPLE -->
<style>