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
@norcross
norcross / rkv_referr_source
Created March 30, 2012 18:00
Add referring site to Gravity Forms
function rkv_referr_source() { ?>
<script type="text/javascript">
// build function for cookie process
function rkv_grab_cookie() {
// check document referrer
if (document.referrer !== '')
var rkv_val = document.referrer;
@wboykinm
wboykinm / cartodb_sketch.html
Created April 2, 2012 17:46
CartoDB Sketch View
<!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>
@wycks
wycks / gist:2315279
Created April 6, 2012 00:05
Relative URLs in WordPress (hide wordpress)
<?php
function roots_root_relative_url($input) {
$output = preg_replace_callback(
'!(https?://[^/|"]+)([^"]+)?!',
create_function(
'$matches',
// if full URL is site_url, return a slash for relative root
'if (isset($matches[0]) && $matches[0] === site_url()) { return "/";' .
// if domain is equal to site_url, then make URL relative
@ccgdesigns
ccgdesigns / TileLayer.Bing.js
Created April 9, 2012 11:21 — forked from pagameba/TileLayer.Bing.js
Leaflet Bing layer
/*
* 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.
*

High level style in javascript.

Opinions are like assholes, every one has got one.

This one is mine.

Punctuation: who cares?

Punctuation is a bikeshed. Put your semicolons, whitespace, and commas where you like them.

@jlord
jlord / index.html
Created April 19, 2012 06:39
Geocoder with Leaflet
<html>
<head>
<title>I'm learning</title>
<link rel="stylesheet" href="http://code.leafletjs.com/leaflet-0.3.1/leaflet.css" />
<script src="http://code.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
<script src="http://zeptojs.com/zepto.js" type="text/javascript"></script>
<script src="map.js" type="text/javascript"></script>
<style>
body {margin: 0; padding: 0; text-align: center;}
#button { -webkit-transition: -webkit-transform 3s ease-in; box-shadow: 0 0 25px #EFEF4D; margin: auto; margin-top: 15px; padding: 3px 6px; height: 20px; width: 200px;}
@oliverbarnes
oliverbarnes / install_postgis_osx.sh
Created April 20, 2012 14:45 — forked from juniorz/install_postgis_osx.sh
Installing PostGIS 1.5.3 (old formula) for Postgres 9.1.3 (Mac)
#If you don't have Postgres installed yet:
# https://github.com/tsaleh/tammer-saleh/blob/master/views/posts/installing-postgresql-for-rails-3-1-on-lion.html.textil
#1. Install postgis 1.5.3. Latest is 2.0.0, so using url old formula on github
brew install https://raw.github.com/mxcl/homebrew/8a04a43763906e6a9bef68881acf997f3a6f6687/Library/Formula/postgis.rb
#2. Create a template to be used on creating GIS-enabled databases
createdb template_postgis
#3. Import Postgis Data
@billeisenhauer
billeisenhauer / tripcase-model-api
Created April 20, 2012 21:33
TripCase Model API
// Session
require(['models/session'], function(Session) { window.Session = Session });
s = new Session();
s.fetch();
// Returns a Session model with the following:
// - attributes contain simple attributes
// - trips (TripList) a collection of Trip models; 'light' versions.
// - user (User) the logged in user; check its attributes for email and name.
// - expenseCategories
// - expensePaymentTypes
@norcross
norcross / head_redirect.php
Created April 29, 2012 22:12
PHP redirects
<?php
add_action ('wp_head', 'rkv_new_redirects', 1); // create redirects
function rkv_new_redirects() {
$newurl = 'http://mynewurl.com';
$slug = basename(get_permalink());
$cat = get_query_var('cat');
$cat_s = get_category ($cat);
$c_slug = $cat_s->slug;
// set up
@mbleigh
mbleigh / welcome.html
Created May 1, 2012 03:19
This is real output from Divshot, the drag and drop editor that developers and designers can be proud to use.
<!doctype html>
<html>
<head>
<title>Divshot Welcome - Welcome to Divshot (Divshot Prototype)</title>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<script type='text/javascript' src='http://divshot.dev/assets/preview.js'></script>
<link rel='stylesheet' href='http://divshot.dev/assets/preview.css' />
</head>
<body>
<div class='container-fluid'>