Skip to content

Instantly share code, notes, and snippets.

@linssen
linssen / branches.sh
Created April 26, 2013 10:29
A script to auto track all remote branches on a cloned git repo. In a newly cloned repo the current branch will be the default on Github (not always necessarily master). Credit to https://coderwall.com/p/0ypmka for the original which I adapted to figure out the current branch and exclude that and not master by default.
#!/bin/bash
CURRENT=`git branch | grep "*" | sed "s/* //"`
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v $CURRENT`; do
git branch --track ${branch#remotes/origin/} $branch
done
@linssen
linssen / google_webfont.coffee
Created April 14, 2013 18:53
CoffeeScript to include web fonts from Google. See how it compiles below.
window.WebFontConfig =
google:
families: ['Droid+Serif:400,700,400italic:latin']
wf = document.createElement('script')
wf.src = """#{if document.location.protocol == 'https' then 'https' else 'http'}
://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js"""
wf.type = "text/javascript"
wf.async = "true"
s = document.getElementsByTagName("script")[0]
@linssen
linssen / hack.sh
Created November 5, 2012 10:01 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/4016420/hack.sh | sh
#
@linssen
linssen / template_rel_example.html
Created September 10, 2012 19:12
SAEF template examples
{exp:linssen_saef_field name="my_relationship_field"}
<p><label for="{id}">{label}</label><br />
<select name="{id}" id="{id}">
{options}<option value="{value}">{name}</option>{/options}
</select>
</p>
{/exp:linssen_saef_field}
@linssen
linssen / gist:3693060
Created September 10, 2012 19:11
Archive Git repo
git archive HEAD | gzip > $PWD\.tar\.gz
@linssen
linssen / gist:3693045
Created September 10, 2012 19:09
Auto delete Dropbox public files after two weeks
00 16 * * * find ~/Dropbox/Public -mindepth 1 -ctime +14 -delete
<?php
/**
* Erskine Design ImageResizer (PHP5 only)
* REQUIRES ExpressionEngine 2+
*
* @package ED_ImageResizer
* @version 1.0.4
* @author Glen Swinfield (Erskine Design)
* @copyright Copyright (c) 2009 Erskine Design
@linssen
linssen / the_includes.html
Created May 23, 2012 08:23
Extending the jQuery Sortable With Ajax & MYSQL
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js"></script><link rel='stylesheet' href='styles.css' type='text/css' media='all' />
@linssen
linssen / ee1x_cookies.md
Created May 22, 2012 08:47
ExpressionEngine cookies

ExpressionEngine 1.x cookies

This document outlines all of the cookies use by ExpressionEngine 1.x. With the EU cookie law coming into force on May 26th, it's important to know what cookies are set, which are 'essential' and why they are there. Hopefully this will help advise your decision process when altering your site to adhere.

I haven't yet gotten to any special addons etc. or even forums or comments. Please do fork and and send pull requests if you'd care to add anything.

Non essential

@linssen
linssen / change_form.html
Created April 27, 2012 16:15
Django admin Chosen template
{% extends "admin/change_form.html" %}
{% load i18n admin_static admin_modify %}
{% load url from future %}
{% load admin_urls %}
{% block extrahead %}
{{ block.super }}
{% if not is_popup %}
<link href="{{ STATIC_URL }}admin/chosen/chosen.css" type="text/css" media="screen" rel="stylesheet">