Skip to content

Instantly share code, notes, and snippets.

diff --git a/drupal-org.make b/drupal-org.make
index d4304a1..86fdcbe 100644
--- a/drupal-org.make
+++ b/drupal-org.make
@@ -28,7 +28,7 @@ projects[dynamic_formatters][version] = 2.0-alpha2
projects[field_group][version] = 1.1
projects[features][version] = 1.0-beta6
projects[strongarm][version] = 2.0-beta5
-projects[views][version] = 3.1
+projects[views][version] = 3.3
@blambi
blambi / drupal-core-system-add-machinename-column.patch
Created February 24, 2012 12:33
[Drupal 7] Add a machinename column to the modules listing
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index 7ed232a..9a71679 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -797,6 +797,8 @@ function system_modules($form, $form_state = array()) {
foreach ($visible_files as $filename => $module) {
$extra = array();
$extra['enabled'] = (bool) $module->status;
+ $extra['machinename'] = $module->name;
+
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC43QhPnhjlxGqyWwLpLBMgxx86TKxlPYGo9QQTPC78n5Uiy9p4H0XRlaY6SlNQIx/DcTziz7H/vHN5hLr0cnueWuGdLDygZQaiuAZvlgnjBhQIziaYcjV8mR8752YPPam0/IpSRAcaNLjqDyjjWnVQ0BYVOpgZpDKIzEh/RUW7gMvgcm6PBSqtBeV+K2l1KhI2XQIkb1787PK+2hLAovReavZu+T2oDd2wgirpW2y6t35TBiB1ZsetqH5bhFDFa3SuYtUvPEZ2YG6R0EpDgEu+tHal5vC2Xvko056rZnOrdHLtX9FPw4F6YzZZIaTA2KrQ6XurrlwhnmReZwUNyD/r patrik@lembke
@blambi
blambi / gist:2000117
Created March 8, 2012 10:12
fun fun fun
foreach($facets as $gid => $value)
{
usort($facets[$gid]['items'],
function($a, $b) {
return strcmp($a['title'], $b['title']);
}
);
$facets[$gid]['items'] = array_map( function($x) { return $x['link']; }, $facets[$gid]['items']);
}
@blambi
blambi / colours.py
Created July 17, 2012 11:59
Little game I made to entertain my one year old on a spare laptop
#!/usr/bin env python
import pygame
from random import randint
d = pygame.display.set_mode( (800, 600) )
pygame.display.toggle_fullscreen()
def rnd_bg():
d.fill(((randint(0, 255), randint(0, 255), randint(0, 255), 255)))
@blambi
blambi / gist:5263533
Last active December 15, 2015 12:58
Converting MV2 Inventories from yaml to json files
#!/usr/bin/env python
import sys
import yaml
import json
def convert(infile):
x = yaml.load(open(infile, 'r').read())
print "Converting"
print x
---
layout: default
title: Just another 15mm miniature blog
---
<div id="home">
{% for post in paginator.posts %}
<div class="post">
<h1>{{ post.title }}</h1>
<div class="posted-date">Posted on {{ post.date | date_to_string }}</div>
@blambi
blambi / gist:6485114
Created September 8, 2013 14:29
What I used to restore my mail from claws-mail imap caches after the servers disk died with to old backups.
#!/usr/bin/env python
from email.parser import Parser
import smtplib
import sys
import os
from hashlib import md5
def sendmail(mail_str):
headers = Parser().parsestr(mail_str)
# Blowfish cipher needs 8 byte blocks to work with
def __pad_file(self, file_buffer):
pad_bytes = 8 - (len(file_buffer) % 8)
for i in range(pad_bytes - 1): file_buffer += chr(randrange(0, 256))
# final padding byte; % by 8 to get the number of padding bytes
bflag = randrange(6, 248); bflag -= bflag % 8 - pad_bytes
file_buffer += chr(bflag)
return file_buffer
def __depad_file(self, file_buffer):
pad_bytes = ord(file_buffer[-1]) % 8
@blambi
blambi / ed.app
Created December 4, 2014 15:00
Perm ED
"""A minimalist try at a text editor"""
class App( Applet ):
caption = u"Ed"
def __init__( self, term ):
Applet.__init__( self, term )
self.text = list()
self.filename = u'unnamed'
self.input = u''