Skip to content

Instantly share code, notes, and snippets.

@brookemckim
brookemckim / hls
Created June 8, 2011 19:05
Roku Recommended FFMPEG h264 Preset
ffmpeg -i <inputFile> -f mpegts -acodec libfaac -vcodec libx264 \ -vpre roku -crf 15 -threads 0 ~/OneTransportStreamFile3200.ts
@loonies
loonies / 1_phpunit-api.md
Last active January 19, 2024 07:34
PHPUnit Cheat Sheet

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this-&gt;anything()
@kaleb
kaleb / aliases
Created October 15, 2011 15:51
Gmail on Mutt
#~/.mutt/aliases
alias nick Nicholas Levandoski <nick.levandoski@auglug.org>
alias tim Timothy Pitt <timothy.pitt@auglug.org>
alias steven Steven Jackson <sjackson@auglug.org>
alias kaleb Kaleb Hornsby <kaleb.hornsby@auglug.org>
alias alug-admin nick, tim, steven
@dupuy
dupuy / README.rst
Last active April 23, 2024 23:38
Common markup for Markdown and reStructuredText

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

@niklasl
niklasl / rdf_vocab_to_jsonld_context.py
Created May 22, 2012 16:41
Generating a JSON-LD context from an RDF vocabulary
import sys
from rdflib import *
fpath = sys.argv[1]
prefix = sys.argv[2]
g = Graph().parse(fpath, format='n3' if fpath.endswith(('.n3', '.ttl')) else 'xml')
def name_pair(item):
qname = item.qname()
@cjgiridhar
cjgiridhar / tornadowhoosh.py
Created September 21, 2012 11:15
Tornado - Whoosh
import whoosh,os
from whoosh import index
import whoosh.index
import whoosh.qparser
import tornado.ioloop
import tornado.web
class Search(object):
def __init__(self, indexdir, searchstr):
self.indexdir = indexdir
import java.awt.*;
import java.awt.image.*;
import java.io.*;
import java.util.*;
import java.util.List;
import javax.swing.*;
import javax.imageio.ImageIO;
import java.net.*;
/**
@ndarville
ndarville / business-models.md
Last active January 13, 2024 17:27
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@thbar
thbar / how-to-diff-pdf-files-with-git-and-diffpdf.md
Last active November 3, 2023 06:01
How to diff PDF files with Git

One can use MD5 or plain text diff to see differences in PDF files. If that's not enough, here's how to use diff-pdf which knows how to diff based on appearance or words:

  • brew install diff-pdf
  • edit your ~/.gitconfig to add this:
[difftool "diffpdf"]
  cmd = diff-pdf --view \"$LOCAL\" \"$REMOTE\"
@willurd
willurd / web-servers.md
Last active April 28, 2024 21:38
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000