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
@netconstructor
netconstructor / osm2geo.js
Created November 29, 2011 14:42 — forked from tecoholic/osm2geo.js
OSM2GEO - A JS Converter to convert OSM to GeoJSON
/**************************************************************************
* OSM2GEO - OSM to GeoJSON converter
* OSM to GeoJSON converter takes in a .osm XML file as input and produces
* corresponding GeoJSON object.
*
* AUTHOR: P.Arunmozhi <[email protected]>
* DATE : 26 / Nov / 2011
* LICENSE : WTFPL - Do What The Fuck You Want To Public License
* LICENSE URL: http://sam.zoy.org/wtfpl/
*
@bradt
bradt / wp-image-crop-position.php
Created November 29, 2011 20:56
WordPress: Set an image's crop position and rotates images based on EXIF information if necessary
<?php
/* Example Usage:
* bt_add_image_size( 'product-screenshot', 300, 300, array( 'left', 'top' ) );
* bt_add_image_size( 'product-feature', 460, 345, array( 'center', 'top' ) );
*/
add_filter( 'intermediate_image_sizes_advanced', 'bt_intermediate_image_sizes_advanced' );
add_filter( 'wp_generate_attachment_metadata', 'bt_generate_attachment_metadata', 10, 2 );
/**
@mxswd
mxswd / email_stats.rb
Created December 5, 2011 15:39
Statistics on email activity.
#!/usr/bin/env ruby
# email_stats.rb
# ======================`README.md`========================
#
# Email Stats
# ===========
#
# Requirements
# ------------
@andrewxhill
andrewxhill / ST_ClipEx.sql
Created December 8, 2011 17:19
ST_ClipEx a working variation of ST_Clip for raster
CREATE OR REPLACE FUNCTION ST_ClipEx(rast raster, x int, y int, width int, height int)
RETURNS raster AS
$$
DECLARE
newrast raster := ST_MakeEmptyRaster(width, height, ST_UpperLeftX(rast), ST_UpperLeftY(rast),
ST_ScaleX(rast), ST_ScaleY(rast), ST_SkewX(rast), ST_SkewY(rast), ST_SRID(rast));
numband int := ST_Numbands(rast);
band int;
cx int;
cy int;
@tokumine
tokumine / zoom_dependent_carto.md
Created December 9, 2011 16:27
zoom dependent Carto on CartoDB
@andrewxhill
andrewxhill / gist:1452995
Created December 9, 2011 19:48
Clustering stylings for CartoDB
#points_na{
marker-fill:#FF6600;
marker-opacity:0;
marker-width:35;
marker-line-color:white;
marker-line-width:3;
marker-line-opacity:0;
marker-placement:point;
marker-type:ellipse;
marker-allow-overlap:true;
@norcross
norcross / rkv-admin-style.css
Created December 13, 2011 12:29
WP Admin Skin
@charset "utf-8";
/* CSS Document */
html, body {
height: 100%;
}
html {
background-color: #fff;
}
body.login {
background:#1D2736;
@wesbos
wesbos / gist:1476820
Created December 14, 2011 14:36
PhantomJS Screenshot
var page = new WebPage(),
address, output, size;
address = "http://www.metachunk.com/";
width = 1024; height = 600;
output = "./screenshots/wat-"+width+"X"+height+".png";
page.viewportSize = { width: width, height: height };
if (phantom.args.length === 3 && phantom.args[1].substr(-4) === ".pdf") {
@fat
fat / gist:1484342
Created December 16, 2011 03:39
Simple Template
<div class="timeline">
<!-- load more button -->
<button>{{message}}</button>
<!-- tweet object -->
{{#tweets}}
{{> tweet}}
{{/tweets}}
@saleiva
saleiva / twitter_cdb
Created December 18, 2011 13:24
Twitter Streaming API and CartoDB
var twitter = require('ntwitter');
var http = require('http');
var cartodb_username = '' // your CartoDB username
, cartodb_password = '' // your CartoDB password
, cartodb_consumer_key = '' // Your CartoDB API Key ('YOUR KEY')
, cartodb_consumer_secret = '' // Your CartoDB API Secret ('YOUR SECRET')
, cartodb_private_query = '' // An SQL query to run eg. 'SELECT cartodb_id FROM cables LIMIT 20'
, cartodb_request_url = 'https://' + cartodb_username + '.cartodb.com/oauth/request_token'
, cartodb_access_url = 'https://' + cartodb_username + '.cartodb.com/oauth/access_token'