Skip to content

Instantly share code, notes, and snippets.

@linssen
linssen / linssen.js
Created April 27, 2012 15:56
Chosen in Django admin JavaScript
var $chosens = {};
/**
* Hijacking the pop up script and overwriting it
*/
function showAddAnotherPopup(triggeringLink) {
var name = triggeringLink.id.replace(/^add_/, '');
name = id_to_windowname(name);
href = triggeringLink.href
if (href.indexOf('?') == -1) {
@linssen
linssen / linssen.css
Created April 27, 2012 16:04
Chosen in Django admin CSS
/**
* We need form rows overflow to be visible so we can see
* the chosen options
*/
div.form-row {
overflow:visible;
}
div.form-row:after {
content:" ";
display:block;
@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">
@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 / 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' />
<?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 / 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
@linssen
linssen / gist:3693060
Created September 10, 2012 19:11
Archive Git repo
git archive HEAD | gzip > $PWD\.tar\.gz
@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 / 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
#