Skip to content

Instantly share code, notes, and snippets.

View tonetheman's full-sized avatar

Tony Colston tonetheman

View GitHub Profile
@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active April 25, 2024 04:16
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@haasn
haasn / about:config.md
Last active April 2, 2024 18:46
Firefox bullshit removal via about:config

Firefox bullshit removal

Updated: Just use qutebrowser (and disable javascript). The web is done for.

@poizan42
poizan42 / Mandelbrot16x16-fixed.pdf
Last active August 29, 2015 14:25
16x16 Mandelbrot set rendered by a tint transform (it's not technically a valid pdf because it lacks lengths and the xref table which is hard to write by hand, but every reader can reconstruct them anyways). The Mandelbrot16x16-fixed.pdf file has been opened and saved with Adobe Reader which repairs the file (but makes it human unreadable).
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@need12648430
need12648430 / lcg.js
Last active August 29, 2015 14:20
Linear congruential generator (Seedable PRNG) with weighted choices and shuffling in 1.4kb of clean JS.
var LCG = (function () {
var c = 0x93456789, a = 0x169659, mod, mask, r;
mask = (mod = Math.pow(2, 31)) - 1;
function LCG(seed) {
this.seed = seed || new Date().getTime();
}
LCG.prototype = {
nextInt:
@monostere0
monostere0 / GlobalEvents.js
Last active February 19, 2020 08:10
Fire events between different browser windows using localStorage.
(function(window){
var EVENT_EXISTS = 'GlobalEvents: Event already exists.';
var eventIsRunning,
_eventStack,
_findByName,
stackEvent,
removeEvent,
eventListener,
@rodricios
rodricios / summarize.py
Last active November 18, 2020 17:21
Flipboard's summarization algorithm, sort of
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pip install networkx distance pattern
In Flipboard's article[1], they kindly divulge their interpretation
of the summarization technique called LexRank[2].
@vrinek
vrinek / gist:bda51f6fc8b22b5df301
Last active February 10, 2024 20:21
Blizzard Software Engineering Reading

Blizzard Software Engineering Reading

by Jay Baxter (circa 2009)

Associate developer

"This list is for people who want to become Associate Software Engineers at Blizzard. An associate should have skills at the level indicated by these books. Note that this is almost completely focused on C++ programming. This list is incomplete. I need a book on how to become a professional. I've listed several books that give examples of professional behavior, but not one on the actual training."

Programming: Principles and Practice Using C++

by Bjarne Stroustrup

@espadrine
espadrine / sync-stdin.js
Created September 12, 2014 11:32
How to read stdin synchronously in nodejs.
var fs = require('fs');
// Returns a buffer of the exact size of the input.
// When endByte is read, stop reading from stdin.
function getStdin(endByte) {
var BUFSIZE = 256;
var buf = new Buffer(BUFSIZE);
var totalBuf = new Buffer(BUFSIZE);
var totalBytesRead = 0;
var bytesRead = 0;
@scripting
scripting / RiverReader
Last active August 29, 2015 14:03
Minimal code for reading a river
<html>
<head>
<title>Minimal River Reader</title>
<script src="http://fargo.io/code/jquery-1.9.1.min.js"></script>
</head>
<body>
<script>
var theRiver;
function onGetRiverStream (updatedFeeds) {
theRiver = updatedFeeds;
@takeshixx
takeshixx / hb-test.py
Last active March 9, 2024 13:37
OpenSSL heartbeat PoC with STARTTLS support.
#!/usr/bin/env python2
"""
Author: takeshix <takeshix@adversec.com>
PoC code for CVE-2014-0160. Original PoC by Jared Stafford (jspenguin@jspenguin.org).
Supportes all versions of TLS and has STARTTLS support for SMTP,POP3,IMAP,FTP and XMPP.
"""
import sys,struct,socket
from argparse import ArgumentParser