Skip to content

Instantly share code, notes, and snippets.

View drhodes's full-sized avatar

Derek Rhodes drhodes

View GitHub Profile
while true; do
rtmpdump -v -r rtmp://livestfslivefs.fplive.net/livestfslive-live/ \
-y "aljazeera_en_veryhigh?videoId=747084146001&lineUpId=&pubId=665003303001&playerId=751182905001&affiliateId=" \
-W "http://admin.brightcove.com/viewer/us1.24.04.08.2011-01-14072625/federatedVideoUI/BrightcovePlayer.swf" \
-p "http://english.aljazeera.net/watch_now/" \
-a "aljazeeraflashlive-live?videoId=747084146001&lineUpId=&pubId=665003303001&playerId=751182905001&affiliateId=" \
| mplayer - -dumpstream -dumpfile egypt-$(date +%s)
done;
def square(x){
(x, x) > mul > return;
}
def square(x){
|= mul
|< (x, x)
|> return;
}
@drhodes
drhodes / mirror.py
Created January 16, 2012 04:58
mirrors .map file
#! /usr/bin/env python
import sys
class Mirror(object):
def __init__(self):
self.mappath = sys.argv[1]
self.infile = open(self.mappath)
self.outfile = open("tmp-mirror.map", 'w')
self.text = self.infile.read()
@drhodes
drhodes / lolcate.sh
Last active April 13, 2020 14:32
lolcate, comically fast file locater sometimes two orders of magnitude faster than mlocate
#!/bin/bash
# Please read to make sure you really want to use this program
# it hasn't been tested.
# Requires lzop
mkdir -p ~/.lolcate
case "$1" in
@drhodes
drhodes / gist:3461123
Created August 25, 2012 05:14
Type annotated file positions
$ cat hello.rs
fn main() {
let temp = 0;
io::println(~"Hello world!");
}
$ rustc --pretty pos ./hello.rs | typelist.py
<intrinsic> 12 8 12 30 fn() -> *()
@drhodes
drhodes / main.go
Created October 4, 2012 03:11
crashing pq by specifying runtime.GOMAXPROCS
package main
import (
_ "github.com/bmizerany/pq"
//"runtime"
"database/sql"
"log"
"math/rand"
)
enum Shape {
Circle {
radius: float
},
NoShape,
}
fn main() {
let mut c = Circle{radius: 5.0};
match c {
function _square($0$0, $0$1) {
var label = 0;
var __stackBase__ = STACKTOP; STACKTOP = (STACKTOP + 32)|0; assert((STACKTOP|0) < (STACK_MAX|0));
var $__make_return_pointer=__stackBase__;
var $__llargbundle=(__stackBase__)+(8);
var $1=(__stackBase__)+(24);
var $2=(($__llargbundle)|0);
var $st$0$0=(($2)|0);
HEAP32[(($st$0$0)>>2)]=$0$0;
var $st$1$1=(($2+4)|0);
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-scroll-header-panel/core-scroll-header-panel.html">
<link rel="import" href="../paper-toast/paper-toast.html">
<link rel="import" href="../google-map/google-map.html">
<link rel="import" href="../code-mirror/code-mirror.html">
<polymer-element name="my-element">
@drhodes
drhodes / gist:8a528fe5ee8085d6597e
Created October 22, 2015 21:35
coursenotes2url.py
#!/usr/bin/env python
import argparse
URL_TEMPLATE = "http://computationstructures.org/notes/%s/notes.html#TARGET_"
# takes a section number like 6.5.4 and converts it to a URL
def section_to_url(chapter, section):
lookup = {
'3': "information",
'4': "circuits",