This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Chatbot integration plugin for Pidgin | |
# (c)2011, <samuli@tuomola.net> | |
# | |
# INSTALL: | |
# 1. Get Net::AIML, e.g. sudo cpan App::cpanminus; sudo cpanm Net::AIML | |
# 2. Copy the script in your ~/.purple/plugins/ directory | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, sqlite3 | |
if len(sys.argv) < 2: | |
print 'Syntax: %s gameid' % sys.argv[0] | |
exit() | |
gameid = sys.argv[1] | |
con = sqlite3.connect('test.db') | |
c = con.cursor() | |
sql = 'select name,addr from fields where gameid=?' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Jison rules for parsing simple boolean expressions | |
* (c)2011, <samuli@tuomola.net> | |
* | |
* Usage: npm install jison && jison sqlaus.jison && node test-sqlaus.js | |
* | |
* Meant primarily for generating SQL clauses for m:m table structure. | |
* | |
* Depends on shared scope to provide.. | |
* functions: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Renounce thy manual directory crawling and embrace the key shortcuts | |
cd() { | |
#set -x # uncomment to debug | |
local D="${*-~}" MAX=$(( ${#DIRSTACK[@]}-1 )) POS= | |
D=${D/#~/$HOME} | |
[ "$D" == "-" ] && D=+1 | |
# if given a shift parameter, verify dir still exists | |
if is_numeric "$D"; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
A short example of a web.py page that triggers a refresh of | |
the SVN log html fragment periodically when the page is visited. | |
To configure WSGI for apache do something like this.. | |
<IfModule mod_wsgi.c> | |
# http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives | |
# default: processes=1 threads=15 | |
WSGIDaemonProcess ci user=tomcat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 646ed51cc5e2de3feb79f22d6b832b47a92ac433 Mon Sep 17 00:00:00 2001 | |
From: Samuli Tuomola <samuli.tuomola@gmail.com> | |
Date: Fri, 16 Mar 2012 21:27:02 +0200 | |
Subject: [PATCH] Warn if export extension is supported by multiple writers. | |
Also, skip plugins that don't report any name filters. | |
--- | |
src/tiled/mainwindow.cpp | 23 ++++++++++++++++++----- | |
1 files changed, 18 insertions(+), 5 deletions(-) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* NOTE: requires customization, likely not working as-is. | |
*/ | |
public class FormController { | |
public Account_detail__c detail {get;set;} // DIY | |
public List<String> detailFields {get;set;} | |
public Map<String,String> detailTypes {get;set;} | |
public Map<String,String> detailListAsJSON {get;set;} | |
public FormController(ApexPages.StandardController controller) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Revert Skyrim installation back to vanilla | |
# 2014, <samuli@tuomola.net> | |
import os | |
from datetime import datetime | |
def mkbackupdir(prefix='../skyrim-backup-'): | |
dn = os.path.abspath(prefix + datetime.strftime(datetime.now(), '%Y%m%d-%H%M%S')) | |
os.mkdir(dn) | |
return dn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:if(typeof(_4ac)!=='undefined') _4ac.remove(); | |
_4ac=(function() { | |
var links = [].slice.call(document.querySelectorAll('.file')); | |
var cur_link = -1; | |
var expand = true; | |
function isNext(e) { return e.keyCode == 188 || e.keyCode == 192; }; | |
function isPrev(e) { return e.keyCode == 190 || (e.keyCode == 192 && e.shiftKey); }; | |
function handleKey(e){ | |
if(isPrev(e) || isNext(e)) { | |
open(cur_link + (isPrev(e)?-1:1)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put it in .bash_aliases | |
# generates html from stdin, takes size of batch as argument | |
function openimgs { | |
MAX=${1:-6} | |
TMPL=~/openimgs-template.html | |
OUTF="openimgs-$$.html" | |
local IFS=$'\n' | |
BUF=($(cat -)) | |
local IFS=$' \n' |
OlderNewer