Skip to content

Instantly share code, notes, and snippets.

View seb-thomas's full-sized avatar
💭
😷

Sebastian Thomas seb-thomas

💭
😷
View GitHub Profile
@seb-thomas
seb-thomas / gist:2036534
Created March 14, 2012 13:38
WP single post category switch
<?php
$post = $wp_query->post;
if ( in_category('features') ) {
include(TEMPLATEPATH . '/single-features.php');
} else {
include(TEMPLATEPATH . '/single-single.php');
}
?>
@seb-thomas
seb-thomas / styles.less
Created March 16, 2012 10:27
Heavily edited version of less style sheet used in a project.
/*style sheet for global styles and layout blocks*/
//Vars
//Colours
@text-gray: #808080;
@border-red: #ec1b34;
@border-gray: #dedede;
//Mixins
@seb-thomas
seb-thomas / master.html
Created March 16, 2012 10:28
Edited version of our master template, with textbox for shadow
{% load cms_tags sekizai_tags menu_tags %}
<!doctype html>
<!-- stripped and modified basis fo the paul irish html5 boilerplate (in particular:
https://raw.github.com/paulirish/html5-boilerplate/master/index.html) -->
<head>
<meta charset="utf-8">
<title>{{ request.current_page.get_title }}</title>
<meta name="description" content="">
<meta name="author" content="">
@seb-thomas
seb-thomas / Path Gen
Created June 6, 2012 17:04
Code to generate a path object for https://github.com/JoelBesada/scrollpath from an array, using coords in px relational to current xy
//Code to generate a path object from an array, using coords in px relational to current xy
function do_with_args(func, args1, args2){
args = jQuery.merge(args1, args2);
console.log(func, args)
return func.apply(null, args);
}
var OPERATIONS = {
@seb-thomas
seb-thomas / markers.json
Created October 18, 2012 17:08
maps json
{
"marker0": {
"lat": "51.500024295706694",
"lng": "-0.11579284667970313",
"title": 'Lima'
},
"marker1": {
"lat": "51.500024295706694",
"lng": "-0.11579284667970313",
"title": 'London'
@seb-thomas
seb-thomas / gist:3981525
Created October 30, 2012 16:58
more than one table
class Shoe(Base):
"""
Container class for our SQLAlchemy object that is actually
from the thbookdata django app model
"""
__tablename__ = 'bookdata_shoe'
__table_args__ = {'autoload': True}
@seb-thomas
seb-thomas / Arguments
Created November 23, 2012 17:39
Arguments
function changeSeasons() {
updateSeason('#spring', 'gray', 'Winter');
updateSeason('#summer', 'orange', 'Autumn');
function updateSeason(sourceSeason, colour, name) {
var element = $(sourceSeason);
var newColour = colour;
var newName = name;
element.css('background-color', newColour);
@seb-thomas
seb-thomas / gist:4275923
Created December 13, 2012 11:46
Maps Robot Todo
- Geolocation (doesnt seem to be workin on mobile)
- Click pin for more info
- Filter pins
- Add pins easily
- Move to cherrypy
- Pretty up interface
@seb-thomas
seb-thomas / gist:4285197
Created December 14, 2012 12:38
set marker from json
$.getJSON('media/js/markers.json', function(data){
$.each(data.markers, function(i, marker){
map.addMarker({
id: i,
tags: marker.tag,
lat: marker.latitude,
lng: marker.longitude,
infoWindow: {
content: '<h2>' + marker.name + '</h2><p>' + marker.address + '</p>'
}
$.getJSON('media/js/markers.json', function(data){
$.each(data.markers, function(i, marker){
if (marker.tag = "foo") {
map.addMarker({
id: i,
tags: marker.tag,
lat: marker.latitude,
lng: marker.longitude,
infoWindow: {
content: '<h2>' + marker.name + '</h2><p>' + marker.address + '</p>'