Skip to content

Instantly share code, notes, and snippets.

View patrickkettner's full-sized avatar

patrick kettner patrickkettner

View GitHub Profile
#background {
background-image: url(http://www.a-castle-for-rent.com/images/les-moutons.jpg);
width: 1300px;
height: 750px;
}
#container {
position: relative;
}
#background {
background-image: url(http://www.a-castle-for-rent.com/images/les-moutons.jpg);
width: 1300px;
height: 750px;
}
#container {
position: relative;
color; #6e6e6e;
}
@patrickkettner
patrickkettner / gist:3841905
Created October 5, 2012 19:41
How to install a virtual python environment with pip/easy_install
#!/usr/bin/env bash
# one liner
# curl https://raw.github.com/gist/3841905 | sh
#Download virtual-python.py, this symlinks python to a local copy, so we will have admin writes to do stuff with it
echo "downloading virtual-python"
curl http://svn.python.org/projects/sandbox/trunk/setuptools/virtual-python.py | python
/*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#pragma mark Named Structures
struct MusicControlDelegate {
void **_field1;
public static function getSwarmUAIndex() {
// Lazy-init and cache
if ( self::$swarmUaIndex === null ) {
global $swarmContext;
global $swarmInstallDir;
if (isset($swarmContext)) {echo "i'm set!";};
// Convert from array with string values
// to an object with boolean values
$swarmUaIndex = new stdClass;
.wave {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAUCAYAAACJfM0wAAAAZ0lEQVR42rXRQRHAIBAEwZOAhEhBQiQgIRJwgAQkRAISkICEk5CwPwTcTNV++7P2QVFwI2DfSwRcTAWjQyYBZwLudhZ5GAFXWdHwkkPAg4LVTcGLOk9VCva9i4DVS8EqU/CkYPVQsP9h2ivKEhXCUQAAAABJRU5ErkJggg==);
width: 22px;
height: 500px;
}
body {
background: orange;
}
@patrickkettner
patrickkettner / calendar.jsx
Created November 23, 2012 01:38
a calendar datepicker, for photoshop scripts
var calendarData = {};
var calendar = new Window( 'dialog', 'calendar' );
calendar.MonthAndYear = calendar.add('group');
var MonthAndYear = calendar.MonthAndYear;
var months = ["January", "Feburary", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
var month = MonthAndYear.add('dropdownlist', undefined, months);
var thisMonth = new Date().getMonth();
month.selection = month.items[thisMonth];
@patrickkettner
patrickkettner / ternary.ps1
Created November 30, 2012 02:37
How to do basic ternary operations in Powershell
$variable_to_set = if ($variable_to_check -gt 0 ) { 1 } else { -1 }
@patrickkettner
patrickkettner / gist:4597819
Last active December 11, 2015 11:59
naïve regex to match xml in a database
(?=(<|&lt;))(.*?)(?!.*(>|gt;))
@patrickkettner
patrickkettner / gist:5189012
Created March 18, 2013 17:22
bottle (python web framework) serve nested static files
"""
I don't know why, but this took me forever to figure out.
you just need to match .* and then serve it out of a root folder
with a matching file structure to the request.
leaving this here for the next time I need to roll something from scratch
"""
@route('/static/<filename:re:.*>')
def server_static(filename):
return static_file(filename, root='./static')