Skip to content

Instantly share code, notes, and snippets.

@purem
purem / Scribd file link including original download
Created February 4, 2013 17:16
A comparison of the ttf @font-face fonts generated by pdf2htmlex and scribds proprietary technology. Scribd size: 47,370 bytes PDF2HTMLex size: 92,435 bytes i.e. scribd fonts are 51% of the size.
@purem
purem / Wolfram alpha named parametric curves
Created January 31, 2013 23:05
Wolfram alpha named parametric curves
Enter into wolfram alpha to draw
witch of Agnesi
ampersand curve
Archimedean spiral
Archimedes' spiral
astroid
astroid pedal curve
atriphtaloid
bean curve
@purem
purem / ngram_test.sh
Created January 15, 2013 08:02
Demonstrates two unwanted results with current elasticsearch setup.
# ========================================
# Testing n-gram analysis in ElasticSearch
# ========================================
curl -X DELETE localhost:9200/courses
curl -X POST http://localhost:9200/courses -d '{
"mappings":{
"course":{
"properties":{
"name":{
@purem
purem / gist:3408114
Created August 20, 2012 21:33
Pub-sub to Stretched Request-reply
#include "zhelpers.hpp"
using std::string;
using std::cout;
using std::endl;
int main (int argc, char *argv[])
{
@purem
purem / gist:3350838
Created August 14, 2012 16:55
zmq: Publish / Subscribe problem
//Publisher
int zipcode, temperature, relhumidity;
// Get values that will fool the boss
zipcode = 10001;
temperature = 1;
relhumidity = 2;
// Send message to all subscribers
zmq::message_t topic(6);
@purem
purem / gist:1461857
Created December 11, 2011 18:08
Multiple sectioned list latex
S0:
(20) 20th item
(21) 21st item
S1:
(22) ...
(23) ...
S2:
(24) ...
(25) ...
S3:
upstream backend {
server 127.0.0.1:3031;
}
server {
listen 8080;
root /home/vagrant/apps/jame2/static;
gzip on; gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
var regex = new RegExp("(\w+)[=] ?\"?(\w+)\"?");
while (match = authHeader.match(regex))
{
console.log(match);
words.push(match[1]);
}
console.log(words);
================================================================================
To use the default location, "/usr/local/narwhal", just hit enter/return, or enter another path:
Downloading Narwhal from "http://github.com/280north/narwhal/zipball/master"...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2258k 100 2258k 0 0 192k 0 0:00:11 0:00:11 --:--:-- 277k
Installing Narwhal...
Archive: /tmp/narwhal.zip
9f4894aaeae8c09078400346b27d0e6d7e80dbef
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by tmux configure 1.5, which was
generated by GNU Autoconf 2.64. Invocation command line was
$ ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/tmux/1.5 --sysconfdir=/usr/local/etc
## --------- ##
## Platform. ##