Skip to content

Instantly share code, notes, and snippets.

View sillygwailo's full-sized avatar
💭
Looking for collaborators.

Richard Eriksson sillygwailo

💭
Looking for collaborators.
View GitHub Profile
# LoadModule authn_default_module modules/mod_authn_default.so
# LoadModule mime_magic_module modules/mod_mime_magic.so
# LoadModule auth_digest_module modules/mod_auth_digest.so
# LoadModule authn_alias_module modules/mod_authn_alias.so
# LoadModule authn_anon_module modules/mod_authn_anon.so
# LoadModule authn_dbm_module modules/mod_authn_dbm.so
# LoadModule authn_defa ult_module modules/mod_authn_default.so
# LoadModule authz_owner_module modules/mod_authz_owner.so
# LoadModule authz_dbm_module modules/mod_authz_dbm.so
# LoadModule authz_default_module modules/mod_authz_default.so
; from the auto-generated make from drupal.org
projects[diff] = 2.0
projects[freelinking] = 1.10
projects[token] = 1.13
projects[talk] = 1.6
projects[pathauto] = 1.3
projects[wikitools] = 1.2
projects[flexifilter] = 1.2
projects[admin_menu] = 1.5
projects[extlink] = 1.11
<?php
// Display a list of categories with zero nodes associated with them.
// This code once appeared inside a node. Now I use a view. Publishing it for posterity.
$results = db_query(db_rewrite_sql('SELECT t.* FROM {term_data} t WHERE t.vid = %d ORDER BY weight, name', 't', 'tid'), 1);
while ($term = db_fetch_object($results)) {
if (taxonomy_term_count_nodes($term->tid) == 0) {
$rows[] = array(
l($term->name, "taxonomy/term/$term->tid"),
l(t('edit'), "admin/content/taxonomy/edit/term/$term->tid", array(), $destination),
);
@sillygwailo
sillygwailo / random_md5.py
Created December 29, 2010 23:23
Random MD5 Python script
#!/usr/bin/env python
# Prints an MD5 hash from a random string.
# Helpful resources:
# http://stackoverflow.com/questions/785058/random-strings-in-python-2-6-is-this-ok
# http://docs.python.org/library/hashlib.html
import random, string, hashlib, argparse, sys
name = HashMask
description = "Implements Chris Dary's HaskMask jQuery plugin on password form elements"
core = 7.x
name = Chroma-Hash
description = "Implements Mattt Thompson's Chroma-Hash jQuery plugin on password form elements"
core = 7.x
@sillygwailo
sillygwailo / ubercart6.make
Created May 24, 2011 20:25
Ubercart Drush Make files
api = 2
core = 6.x
projects[drupal] = 6.20
projects[cck] = 2.9
projects[token] = 1.16
projects[filefield] = 3.10
projects[imageapi] = 1.10
projects[imagecache] = 2.0-beta12
projects[imagefield] = 3.10
projects[thickbox] = 1.6
@sillygwailo
sillygwailo / gist:998012
Created May 29, 2011 18:25
List the most-used commands from your Bash history file
#!/usr/bin/env python
import operator, re, os.path
# http://stackoverflow.com/questions/613183/python-sort-a-dictionary-by-value
# http://stackoverflow.com/questions/4510709/python-find-index-of-first-digit-in-string
# http://docs.python.org/tutorial/inputoutput.html
# TODO:
# - account for commands piped in
@sillygwailo
sillygwailo / Open in Chrome from Safari.scpt
Created September 23, 2011 07:16
Open in Chrome from Safari and vice versa
-- from http://www.tuaw.com/2011/03/14/use-applescript-to-open-current-safari-url-in-google-chrome/
-- install FastScripts http://www.red-sweater.com/fastscripts/ and place this AppleScript in the Scripts applications folder for Google Chrome.
-- For me that was ~/Library/Scripts/Applications/Safari
-- You can then assign it a keyboard shortcut. I went with Cmd-Shift-C
property theURL : ""
tell application "Safari"
set theURL to URL of current tab of window 1
end tell
tell application "Google Chrome"
@sillygwailo
sillygwailo / gist:1236908
Created September 23, 2011 07:34
Notify an iOS device (iPhone, iPad, etc.) about the end of a break from Time Out
-- Time Out http://www.dejal.com/timeout/ runs this AppleScript to notify me
-- of the end of a break. It sends a notification to Prowl http://www.prowlapp.com/
-- (iOS notifications via Growl) through a Mac computer's Growl http://growl.info/
-- and is configured as an "Application/Script" to "Run at end" in Time Out's preferences
-- First run the script to register the "application" in Growl, then configure Growl to
-- send the notifications for this "application" as a Prowl display.
-- (By the way, Lallafa is the name of my computer, so you might want to change that.)
tell application "GrowlHelperApp"
set the allNotificationsList to ¬
{"Break's Over"}