Skip to content

Instantly share code, notes, and snippets.

View netconstructor's full-sized avatar
💭
pushing pixels

Christian Hochfilzer netconstructor

💭
pushing pixels
View GitHub Profile
@jkeefe
jkeefe / dc.html
Created May 10, 2011 03:15
Customized DocumentCloud Viewer
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title id="maintitle">Document Viewer</title>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<link href="css/document-cloud.css" media="all" rel="stylesheet" type="text/css">
<!--
Customized document viewer for use with DocumentCloud, at http://documentcloud.org.
@karmi
karmi / .gitignore
Created May 11, 2011 12:03
Donut Chart from ElasticSearch Terms Facet
.DS_Store
tmp/
@karmi
karmi / .gitignore
Created May 15, 2011 11:15
Import your Gmail messages into ElasticSearch and search them with a simple web application.
.DS_Store
*.log
Gemfile.lock
@janfabry
janfabry / wpse17728.php
Created May 19, 2011 20:31
Dump WP image resize information
<?php
/*
Plugin Name: WPSE 17728
Plugin URI: http://wordpress.stackexchange.com/questions/17728/large-image-size-is-cropped-not-proportional
Description: Large image size is cropped, not proportional?
Author: jimilesku
*/
add_filter( 'intermediate_image_sizes_advanced', 'wpse17728_intermediate_image_sizes_advanced' );
function wpse17728_intermediate_image_sizes_advanced( $sizes )
@mhawksey
mhawksey / regform.php
Created May 27, 2011 15:43
Embedding and customising a Google Form in WordPress example (with dynamic parallel session selection)
<?php
$formKey = "blahblahblah"; // ENTER YOUR OWN VALUE - you can find your formkey by going to your live form in the spreadsheet and copying the value from the url
$redirectUrl = "http://www.yoursite.com/thank-you/"; // ENTER YOUR OWN VALUE - the url you want to direct people to after they fill in the form
$dataUrl = "https://spreadsheets0.google.com/spreadsheet/pub?blahblahblah&single=true&gid=1&output=csv"; // ENTER YOUR OWN VALUE - for parallel sessions you need to publish the public sheet via the share settings. This url is not published in the live webpage source
// function to get external webpages/data
function getData($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@arjones
arjones / .gitignore
Created July 8, 2011 21:33 — forked from karmi/.gitignore
Visualizing timelines with Protovis and date histogram facet in ElasticSearch
.DS_Store
tmp/
@indexzero
indexzero / README.markdown
Created August 3, 2011 10:07
EventEmitter2 digs DIRT and ETL applications.

require('child_process').fork() and beyond

Abstract

The purpose of this sample is to show the power of EventEmitter2 in the context of a specific example centered around [DIRT][0] (Data-Intensive Realtime) and [ETL][0] (Extract, Transform, Load) applications in node.js. Given the clear limitations of the V8 heap-size doing any exceptionally large data processing in node will require such patterns, and it is in the interest of the community that we start solidifying them.

Scenario

Lets suppose that you have an ETL that you need to run on a large set of logs which has already been partitioned into files of a size that will by themselves not overload the V8 heap. These kind of size-limited log or data files are common and should need no explaination.

This ETL runs with initial conditions (very common), and thus there may be many sets of worker processes analyzing the same data for different purposes. As an intelligent developer knowning the blocking nature of in-memory data manipulation you decided

@obazoud
obazoud / node_debian_init.sh
Last active July 18, 2022 07:56 — forked from peterhost/node_debian_init.sh
Daemon init script for node.js based app/server (DEBIAN/UBUNTU)
#! /bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
@phillro
phillro / gist:1126799
Created August 5, 2011 02:19
Easy Document Searching with Jquery, jquery-templates and Elastic Search
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
</head>
<body>
<script id="searchResultTemplate" type="text/x-jquery-tmpl">
{{each(i,result) hits}}
@Dottenpixel
Dottenpixel / gist:1161365
Created August 22, 2011 00:01
Flowplayer : Dynamically set cuepoints to fire an event at certain points in Clip's play progress
$f("", {},
{
clip: {
onMetaData: function(c) {
var fd = c.duration;
//create a cue point for 25, 50 and 75% of player progress
var cues = [
{
time: fd * .25 * c.cuepointMultiplier,
name: "25%"