Skip to content

Instantly share code, notes, and snippets.

/**_______________________________________
*
* nfx :: simple effects in few bytes
* ---------------------------------------
*
* @author Andrea Giammarchi
* @site http://www.devpro.it/nfx/
* @version 0.4
* @requires anything *
* * old browsers (IE <= 5) should require JSL
require "openssl"
require "net/smtp"
Net::SMTP.class_eval do
private
def do_start(helodomain, user, secret, authtype)
raise IOError, 'SMTP session already started' if @started
check_auth_args user, secret, authtype if user or secret
sock = timeout(@open_timeout) { TCPSocket.open(@address, @port) }
tell application "Safari"
activate
do JavaScript "alert( '123' );" in document 1
end tell
#!/bin/bash
#DB_CONSTR='-h host -u user -ppasswd -P 20306 searchms'
#SQL='select * from foo'
#FILTER='{ printf "%s\n", $0 }'
SCRIPTFILE=`basename $0`
OUTFILE=${SCRIPTFILE/.sh/.txt}
JOBNAME=${SCRIPTFILE/.sh/}
SCRIPTDIR=$( (cd -P $(dirname $0) && pwd) )
from fabric.api import *
"""
Base configuration
"""
env.project_name = '$(project)'
env.database_password = '$(db_password)'
env.site_media_prefix = "site_media"
env.admin_media_prefix = "admin_media"
env.newsapps_media_prefix = "na_media"
import random
GOAT = 0
CAR = 1
class Door:
def __init__(self, index):
self.index = index
self.gift = GOAT
import re
from mechanize import Browser
br = Browser()
br.set_handle_robots(False)
br.open("http://www.instapaper.com")
br.follow_link(text="Log In")
#print br.title()
br.select_form(nr=0)
@gerald-kim
gerald-kim / CacheEntry.java
Created July 20, 2011 08:58
hibernate CacheEntry modification for faster serialization
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* Copyright (c) 2010, Red Hat Inc. or third-party contributors as
* indicated by the @author tags or express copyright attribution
* statements applied by the authors. All third-party contributions are
* distributed under license by Red Hat Inc.
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
foo:KeyBindings evacuee$ pwd
/Users/evacuee/Library/KeyBindings
foo:KeyBindings evacuee$ cat DefaultKeyBinding.dict
{
/* home */
"\UF729" = "moveToBeginningOfLine:";
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* end */
@gerald-kim
gerald-kim / compile.sh
Created February 3, 2012 07:33
pinboard search bookmarklet
coffee -c pinboard.coffee ; echo -n 'javascript:'; cat pinboard.js | tr '\n' ' ' | sed 's/ / /g' | sed 's/ / /g'