Skip to content

Instantly share code, notes, and snippets.

View radiosilence's full-sized avatar
🔥

James Cleveland radiosilence

🔥
View GitHub Profile
@radiosilence
radiosilence / gnome-terminal-conf.xml
Created June 24, 2011 12:28
Dogs colour scheme for gnome terminal.
<gconfentryfile>
<entrylist base="/apps/gnome-terminal">
<entry>
<key>global/active_encodings</key>
<schema_key>/schemas/apps/gnome-terminal/global/active_encodings</schema_key>
<value>
<list type="string">
<value>
<string>UTF-8</string>
</value>
[Background]
Color=0,0,0
Transparency=false
[BackgroundIntense]
Color=20,44,27
Transparency=false
[Color0]
Color=0,0,0
4 < Jerub> antihero: the api would eventually look like: def render_GET(self, request): return deferToProcess(convert_image, request.args('imageid')).addCallback(lambda image:
(request.write(image), request.close())); return NOT_DONE_YET
@radiosilence
radiosilence / gist:1349683
Created November 8, 2011 23:27
Fixed(?) unix v6 memmove
void*
memmove(void *vdst, void *vsrc, int n)
{
char *dst, *src;
dst = vdst;
src = vsrc;
if(*vdst > *vsrc) {
*vdst += n;
*vsrc += n;
<?php $args = array(
'post_type' => 'attachment',
'orderby' => 'menu_order',
'order' => 'ASC',
'post_mime_type' => 'image',
'post_status' => null,
'post_parent' => get_the_ID()
);
$attachments = get_posts($args);
$count=0; $i=0;

Title

Here is some text that has rudimentary formatting

@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 = []
# 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 / 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') {
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;