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 / on-demand-resize.php
Created May 1, 2012 11:08 — forked from janfabry/on-demand-resize.php
WordPress On-Demand image resizer plugin (first public attempt)
<?php
/*
Plugin Name: On-Demand image resizer
Plugin URI: http://www.monkeyman.be
Description: Create and store images in different sizes on demand
Version: 1.0
Author: Jan Fabry
This plugins monitors 404 requests to the uploads directory and created new images of a requested size. They are saved as new files in the upload directory, not cached somewhere, so future requests are served directly by the server. This allows you to eliminate the creation of intermediate image sizes [see monkeyman-virtual-intermediate-images] or resize images based on the size used in the editor [see monkeyman-resize-image-tags].
@netconstructor
netconstructor / wpse17728.php
Created May 1, 2012 11:08 — forked from janfabry/wpse17728.php
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 )
@netconstructor
netconstructor / smooth_sortable_animating.html
Created June 26, 2012 02:44 — forked from chrisdickinson/smooth_sortable_animating.html
smoothly animate jquery sortable lists.
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
ul { float:left; margin-right:20px; }
body { color:white; font-family:Helvetica, sans-serif; text-shadow:1px 1px 1px rgba(0,0,0,0.2); }
ul { width:512px; overflow:hidden; border-radius:6px; }
@netconstructor
netconstructor / marker-backflip.js
Created June 26, 2012 02:53 — forked from DamonOehlman/marker-backflip.js
Marker Backflip Animation Recipe
marker.animate('rotate', [0], [-Math.PI * 2], {
easing: 'sine.inout'
});
marker.animate('translate', [0, 0], [0, -40], {
easing: 'sine.in',
duration: 500,
complete: function() {
marker.animate('translate', [0, -40], [0, 0], {
duration: 500
@netconstructor
netconstructor / custom.js
Created August 27, 2012 01:45 — forked from drewjoh/custom.js
Dynamic (AJAX) loaded Bootstrap Modal (Bootstrap 2.0)
$(document).ready(function() {
// Support for AJAX loaded modal window.
// Focuses on first input textbox after it loads the window.
$('[data-toggle="modal"]').click(function(e) {
e.preventDefault();
var href = $(this).attr('href');
if (href.indexOf('#') == 0) {
$(href).modal('open');
} else {
@netconstructor
netconstructor / backbone-example.js
Created September 18, 2012 21:11 — forked from andrewxhill/backbone-example.js
CartoDB Backbone for data-driven webpages
// Set the CartoDB user account
var CartoDB = Backbone.CartoDB({
user: viz2
});
// Create a model, here directly from SQL
// You can also do it with simply a table name and list of columns
var parksModel = CartoDB.CartoDBCollection.extend({
sql: "SELECT name FROM nyc_parks ORDER BY ST_Area(the_geom) DESC LIMIT 10"
});

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.

@netconstructor
netconstructor / redbullstratos_cartodb.py
Created October 16, 2012 21:36 — forked from javisantana/redbullstratos_cartodb.py
script used to feed cartodb with the redbull stratos mission info
import time
import urllib2
import json
from cartodb import CartoDBAPIKey, CartoDBException
from secret import API_KEY
URL = 'http://services.redbullstratos.com/LiveData/Get'
cl = CartoDBAPIKey(API_KEY, 'javi')
@netconstructor
netconstructor / gist:3948599
Created October 24, 2012 20:19 — forked from Yegoroff/gist:3093936
PlainElastic.Net facet query builder sample
using System;
using PlainElastic.Net;
using PlainElastic.Net.Queries;
using PlainElastic.Net.Serialization;
using PlainElastic.Net.Utils;
namespace FacetQuerySample
{
class Item
@netconstructor
netconstructor / .gitignore
Created October 26, 2012 21:05 — forked from arjones/.gitignore
Visualizing timelines with Protovis and date histogram facet in ElasticSearch
.DS_Store
tmp/