Skip to content

Instantly share code, notes, and snippets.

View radiosilence's full-sized avatar
🔥

James Cleveland radiosilence

🔥
View GitHub Profile
--- Mimeo.py.old 2012-11-22 13:05:48.340854666 +0000
+++ Mimeo.py 2012-11-22 13:06:13.363724740 +0000
@@ -1219,6 +1219,10 @@
try:
desktop.load()
+ # Skip this desktop if it has no Desktop Entry Group
+ if not DEG in desktop:
+ continue
+
@radiosilence
radiosilence / gist:4040553
Created November 8, 2012 18:19
RequireJS with Zurb Foundation
requirejs.config({
shim: {
'foundation/jquery.foundation.topbar': {
deps: ['jquery'],
},
'foundation/jquery.cookie': {
deps: ['jquery']
},
'foundation/jquery.event.move': {
deps: ['jquery']
// views.py
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.shortcuts import render
from django.http import HttpResponseRedirect
from loisdesigns.forms import EnquiryForm
from django.http import Http404
from django.core.mail import send_mail
#!/bin/bash
ICONPATH=$HOME/.dzen
source ~/.colors
get_now_playing() {
local state
local updating
local update
local string
@radiosilence
radiosilence / gist:3946121
Created October 24, 2012 13:43
Outputs some files that WMs can import and colourify everything with.
import sys
import colorsys
from colorz import colorz
WALLPAPER = '/home/james/.wallpaper'
COLORS = '/home/james/.colors'
XRESOURCES = '/home/james/.Xresources'
cols = ''
xres = """
ul.nav-bar {
@include rounded($color8);
li, li.active, li.has-flyout, li:hover, li.active:hover,
li:last-child {
@include display-font;
background-color: transparent;
a, a:first-child {
font-size: 16px;
}
border: 0;
server {
listen 80;
server_name %(name)s %(aliases)s;
client_max_body_size 4G;
keepalive_timeout 5;
gzip on;
gzip_static on;
gzip_min_length 1000;
gzip_types text/css text/plain text/javascript application/x-javascript application/x-json;
@radiosilence
radiosilence / gist:3698002
Created September 11, 2012 12:18
Get Lat Long
var search_for_address = function(element, o, e_lat, e_lon) {
var address = $('#id_address_1').val() + ', '
+ $('#id_city option:selected').text() + ', '
+ $('#id_postcode').val();
var gc = new google.maps.Geocoder();
var request = {
address: address
}
gc.geocode(request, function(result, status) {
if (status != 'OK') {
# Some sample "models"
class Model(object):
id = None
def save(self, *args, **kwargs):
# Here would be some code that would get a list of objects to call
# invalidate() on when it is saved, based on self.id
@radiosilence
radiosilence / acr.py
Created May 23, 2012 02:54
Fun with recursive acronyms....See the output first as it's getting shown below for some reason.
""" Excuse the horrendous code """
COUNT = 90
WORDS = ['pug', 'user', 'group']
from collections import namedtuple
from copy import copy
g = []