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
@ianAndrewClark
ianAndrewClark / gist:1171014
Created August 25, 2011 15:55
location mapping, with settings
{
"mappings": {
"locations": {
"properties": {
"recordId": {
"type": "long"
},
"namePlain": {
"type": "string",
"store": "no",
@mexitek
mexitek / json_to_postgre.php
Created August 25, 2011 19:12
Script to automate an import process from .json file to postgre DB.
<?php
# Configure
$DB_USER = 'admin';
$DB_PASS = 'qwerty';
$DB_HOST = 'localhost';
$DB_NAME = 'postgis-2-0';
// Param 3 when ran in shell will override this value
$DB_TABLE = 'public.florida_establishments_garman';
// Param 2 when ran in shell will override this value
$CATEGORY = 'misc';
@norcross
norcross / voc_priceeditor.php
Created September 9, 2011 20:30
Mass Price Update for Shopp
<?php
function vol_price_css() {
$theme_dir = get_bloginfo('template_directory');
?>
<style type="text/css">
.shopp h2.voc_title {padding: 12px 15px 25px 0;}
.icon32 {background: url(<?php echo $theme_dir;?>/lib/img/shopp32.png) no-repeat scroll 0 0 transparent;}
.vcc_price_update_btn { position:absolute; top:47px; left:400px;}
table.price-editor tr.headers th{font-weight:bold;}
@boogah
boogah / clean-debug.txt
Created September 10, 2011 21:44
Clean WordPress Debugging
Clean debugging:
// Add this to wp-config.php to cleanly debug a site.
// Just make sure to turn it off when you're done!
define('WP_DEBUG', true); // Turn debugging ON
define('WP_DEBUG_DISPLAY', false); // Turn forced display OFF
define('WP_DEBUG_LOG', true); // Turn logging to wp-content/debug.log ON
# Drop this in a .htaccess file in wp-content to keep the log safe.
<files debug.log>
@imakewebthings
imakewebthings / gist:1216527
Created September 14, 2011 13:20
Extended Slide Events
(function($, deck, undefined) {
$(document).bind('deck.change', function(e, from, to) {
var $prev = $[deck]('getSlide', to-1),
$next = $[deck]('getSlide', to+1);
$[deck]('getSlide', to).trigger('deck.becameCurrent');
$prev && $prev.trigger('deck.becamePrevious');
$next && $next.trigger('deck.becameNext');
});
})(jQuery, 'deck');
/*
* Portions of this code and logic copied from OpenLayers and
* redistributed under the original Clear BSD license terms:
*
* http://trac.osgeo.org/openlayers/browser/license.txt
*
* Copyright 2005-2010 OpenLayers Contributors, released under
* the Clear BSD license. See authors.txt for a list of contributors.
* All rights reserved.
*
@tokumine
tokumine / postgis.rb
Created September 18, 2011 22:12
PostGIS 2.0 SVN Homebrew formula
# PostGIS 2.0SVN Homebrew Formula
#
# To use, place this file in /usr/local/Library/Formula/, then:
#
# > brew install gdal --HEAD --with-postgres
# > brew install postgis --HEAD --with-raster
#
# If you want the original formula back just go to /usr/local and do:
#
# > git checkout Library/Formula/postgis.rb
@tokumine
tokumine / gist:1252442
Created September 30, 2011 01:37
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)
@devstator82
devstator82 / connections.js
Created October 5, 2011 19:42
imap connections
var util = require('util');
var sys = require('sys');
var $ = require('jquery');
var db = require('../../initializers/mongodb');
var Hashtable = require('../../lib/jshashtable');
var ImapConnection = require('imap').ImapConnection;
var Channel = db.model('Channel');
var xoauth = require('../../lib/xoauth');
@mhawksey
mhawksey / gist:1276293
Last active February 28, 2025 08:52
Google App Script to insert data to a google spreadsheet via POST or GET - updated version as per https://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/
/*
Copyright 2011 Martin Hawksey
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software