Skip to content

Instantly share code, notes, and snippets.

View taoeffect's full-sized avatar

Greg Slepak taoeffect

View GitHub Profile
@taoeffect
taoeffect / tracker.php.patch
Last active August 29, 2015 13:56
Patch was emailed to Till Krüss on February 23, 2014. If you can't wait for him to update his Downloads pepper, you can manually apply the patch below. (Note: this was hacked together in a couple of hours. I don't usually code in PHP. I'm hoping he cleans it up and fixes any mistakes.)
--- tracker.php 2011-08-02 14:30:30.000000000 -0500
+++ blah.php 2014-02-24 10:52:23.000000000 -0600
@@ -33,12 +33,8 @@
$this->paranoid = isset($args['paranoid']) ? $args['paranoid'] : FALSE;
$this->db_prefix = $args['tblPrefix'];
- $this->db_id = mysql_connect($args['server'], $args['username'], $args['password']);
-
- mysql_select_db($args['database'], $this->db_id);
-
@taoeffect
taoeffect / gist:8855230
Created February 7, 2014 00:20
DNSChain + DNSCrypt! :-D
dnscrypt-proxy --local-address=127.0.0.1:53 --resolver-address=23.226.227.93:443 --provider-name=2.dnscrypt-cert.okturtles.com --provider-key=1D85:3953:E34F:AFD0:05F9:4C6F:D1CC:E635:D411:9904:0D48:D19A:5D35:0B6A:7C81:73CB
@taoeffect
taoeffect / gist:8258513
Created January 4, 2014 18:19
Traceroutes to and from my current location (in Miami) using apple.com, ufl.edu, and miami.edu.
$ traceroute apple.com
traceroute: Warning: apple.com has multiple addresses; using 17.172.224.47
traceroute to apple.com (17.172.224.47), 64 hops max, 52 byte packets
1 [HOME] (192.168.1.254) 1.992 ms 1.989 ms 13.267 ms
2 [REDACTED].miamfl.sbcglobal.net ([REDACTED]) 31.805 ms 27.143 ms 26.661 ms
3 * * *
4 * * *
5 * * *
6 12.83.70.13 (12.83.70.13) 89.778 ms
12.83.70.21 (12.83.70.21) 26.697 ms 27.636 ms
sbx()
{
echo '(version 1) (trace "/tmp/traceout.sb")' > /tmp/tracein.sb
sandbox-exec -f /tmp/tracein.sb "$@"
sandbox-simplify /tmp/traceout.sb > /tmp/tracesimple.sb
open -a "Sublime Text" /tmp/tracesimple.sb
}
@taoeffect
taoeffect / PARC.lsp
Last active December 24, 2015 18:59
Failed attempt to create a "Perfect Automatic Reference Counting" scheme. This file has been edited. The original attempt can be found here: http://www.newlispfanclub.alh.net/forum/viewtopic.php?f=15&t=3151
(define (Node.)
; for the sake of this example, let's say that this function
; is a "constructor" that returns a symbol pointing to a map.
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; DECLARE "METHODS" FOR NODE ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (Node.set-paret this parent)
@taoeffect
taoeffect / gist:6826028
Created October 4, 2013 13:35
Equivalent CoffeeScript: (title, [options]..., cb) =>
var _this = this,
__slice = [].slice;
(function() {
var cb, options, title, _arg, _i;
title = arguments[0], _arg = 3 <= arguments.length ? __slice.call(arguments, 1, _i = arguments.length - 1) : (_i = 1, []), cb = arguments[_i++];
options = _arg[0];
});
@taoeffect
taoeffect / watchme.html
Created September 21, 2013 22:37
If the contents of the "Watch Zone" changes, it probably means trouble. ^_^ Details: https://www.taoeffect.com/blog/?p=5496
<li class="icon4">
<h3>AES-256 Bit Encryption + Scrypt</h3>
<p>Espionage uses powerful <a href="http://en.wikipedia.org/wiki/Advanced_Encryption_Standard" target="_blank">AES-256 encryption</a>
to protect your files and the super-computer defying <a href="http://www.tarsnap.com/scrypt.html" target="_blank">scrypt</a>
to protect your passwords (instead of relying on OS X's weak keychain).
<span id="sig-start" class="respect-and-protect-your-customers" style="display:none">
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
<!--
$ brew doctor
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libcdt.5.dylib
/usr/local/lib/libcgraph.6.dylib
/usr/local/lib/libchicken.dylib
/usr/local/lib/libcimar.dylib
@taoeffect
taoeffect / gist:5479568
Last active December 16, 2015 18:39
creates an extruded pentagon VBO with indexing and VAO
void CreatePentagon() {
float step = 2.0*M_PI/5, t=0;
Vertex Vertices[7+7+12];
// pentagon[0] = vec3(0);
// bottom
vec4 color(1,0,0,1);
Vertices[0].normal = vec3(0,-1,0);
Vertices[0].color = color;
for (int i=1; i<7; i++, t-=step) {
Vertices[i].pos = vec3(cosf(t),0,sinf(t));
;; add this to your ~/.emacs or ~/.emacs.d/init.el file
;; jump parens
(defun match-paren (arg)
(interactive "p")
(cond
((looking-at "\\s\(") (forward-list 1) (backward-char 1))
((looking-at "\\s\)") (forward-char 1) (backward-list 1))
((looking-at "\\s\{") (forward-list 1) (backward-char 1))
((looking-at "\\s\}") (forward-char 1) (backward-list 1))