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 / gist:2318727
Created April 6, 2012 10:32 — forked from fat/gist:1484342
Simple Template
<div class="timeline">
<!-- load more button -->
<button>{{message}}</button>
<!-- tweet object -->
{{#tweets}}
{{> tweet}}
{{/tweets}}
@netconstructor
netconstructor / image-resize-crop.php
Created April 15, 2012 22:38 — forked from rbncha/image-resize-crop.php
Wordpress Image resize and crop function
<?php
/**
* This function is used to resize and crop image
* based on width from the center of the image
*
* creates new image from jpg,gif,png,bmp to png images
*/
function image_resize_crop ( $src, $w, $h, $dest = null, $override = false, $createNewIfExists = false ) {
$ext = array_pop ( explode ('.', $src) );
$filenameSrc = str_replace (".$ext", '', basename($src) );
@netconstructor
netconstructor / wp-image-crop-position.php
Created April 15, 2012 22:40 — forked from bradt/wp-image-crop-position.php
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 );
/**
@netconstructor
netconstructor / fixed-image-cropper.js
Created April 15, 2012 22:44 — forked from janfabry/fixed-image-cropper.js
WordPress Fixed Image Cropper
// pxi: pixels in image scale
// pxc: pixels in crop scale
// Helper function to create an element with optional attributes
// Doesn't jQuery already have this?
Monkeyman_FixedImageCroppper_createElement = function(tagName, attr)
{
if (!attr) {
attr = {};
}
@netconstructor
netconstructor / fixed-image-cropper.js
Created April 15, 2012 22:44 — forked from janfabry/fixed-image-cropper.js
WordPress Fixed Image Cropper
// pxi: pixels in image scale
// pxc: pixels in crop scale
// Helper function to create an element with optional attributes
// Doesn't jQuery already have this?
Monkeyman_FixedImageCroppper_createElement = function(tagName, attr)
{
if (!attr) {
attr = {};
}
@netconstructor
netconstructor / xbox.js
Created April 22, 2012 15:02 — forked from Jabbslad/xbox.js
Xbox Live Scraper For PhantomJS
/*
Copyright (c) 2012 Jabbslad
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@netconstructor
netconstructor / zoom_dependent_carto.md
Created May 1, 2012 08:37 — forked from tokumine/zoom_dependent_carto.md
zoom dependent Carto on CartoDB
@netconstructor
netconstructor / gist:2566368
Created May 1, 2012 08:38 — forked from tokumine/gist:1252442
OSX notes on postgres 9.0 + postgis 1.5.3 -> postgres 9.1.1 + postgis 2.0.0 SVN
The aim here:
1. upgrade postgres
2. then upgrade postgis
For [1], we'll use pg_upgrade to migrate our data.
on OSX, postgres is installed in usr/local using a symlinked pgsql pointing to pgsql-9.0
1. brew install postgresql (9.1.1 = https://github.com/fragility/homebrew/blob/pgsql/Library/Formula/postgresql.rb)
@netconstructor
netconstructor / cartodb.js
Created May 1, 2012 08:39 — forked from javisantana/cartodb.js
simple cartodb nodejs client
// OAuth supports 3 legged and 2 legged (aka XAuth) authentication.
// This app demonstrates how to use 2 legged authentication with CartoDB
var sys = require('sys')
, querystring = require('querystring')
, OAuth = require('oauth').OAuth
, EventEmitter = require('events').EventEmitter;
function CartoDBClient(user, password, consumer_key, consumer_secret) {
<!DOCTYPE html>
<html>
<head>
<title>CartoDB Sketch View</title>
<script type="text/javascript" src="../js/core.js"></script>
<script type="text/javascript" src="../js/settings.js"></script>
<script type="text/javascript" src="../js/mercator.js"></script>
<script type="text/javascript" src="../js/geometry.js"></script>
<script type="text/javascript" src="../js/model.js"></script>