Skip to content

Instantly share code, notes, and snippets.

<?php
$q = new SplQueue();
$q->setIteratorMode(SplQueue::IT_MODE_KEEP);
$q->push("uno");
$q->push("dos");
$q->push("tres");
$q->push("cuatro");
$q->push("cinco");
$q->rewind();
/*
Very simple. Uses [gs]etters and caller. Precache '_method in Class' relations using unique `Class.jbId_` and `_method.jbOwnerClassIdMap_`.
*/
(function()
{
var nextClassId = 1;
var _methodInClass = function(_fn, Class)
{
var classId = Class.jbId_;
@epplestun
epplestun / gist:7004701
Created October 16, 2013 08:50
Get frame from MJPEG (Motion Webcams)
package com.test;
import java.awt.image.BufferedImage;
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
@epplestun
epplestun / config
Created February 14, 2014 15:48 — forked from kimchy/config
index:
analysis:
analyzer:
string_lowercase:
tokenizer: keyword
filter: lowercase
curl -XPUT 'buntreports:9200/ose' -d '
{
"settings": {
"analysis": {
"analyzer": {
"autocomplete": {
"type": "custom",
"tokenizer": "standard",
"filter": ["standard", "lowercase", "kstem", "edgeNGram"]
}
@epplestun
epplestun / jsdiff.js
Last active August 29, 2015 14:01
jsdiff
/* See LICENSE file for terms of use */
/*
* Text diff implementation.
*
* This library supports the following APIS:
* JsDiff.diffChars: Character by character diff
* JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace
* JsDiff.diffLines: Line based diff
*
@epplestun
epplestun / gource.sh
Created October 7, 2015 13:21 — forked from XueshiQiao/gource.sh
Generate a MP4 Video for your Git project commits using Gource!
# 1.install gource using HomeBrew
$ brew install gource
# 2.install avconv
git clone git://git.libav.org/libav.git
cd libav
# it will take 3-5 minutes to complie, be patient.
./configure --disable-yasm
make && make install
@epplestun
epplestun / service-worker.js
Created October 23, 2015 09:02 — forked from darkwing/service-worker.js
This is the service worker
var EXTRA_FILES = [
"/xjs/_/js/k=xjs.ntp.en_US._WU8vYndmIc.O/m=jsa,ntp,d,csi/rt=j/d=1/t=zcms/rs=ACT90oH3VDY16AdrgBkBZukM4ZIP3OM-xQ",
];
var CHECKSUM = "e0n4rd";
var BLACKLIST = [
'/gen_204\?',
'/async/',
];
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.