Skip to content

Instantly share code, notes, and snippets.

def generate_code(len = 5)
(1..len).map { (("a".."z").to_a + ("A".."Z").to_a + (0..9).to_a)[rand(62)] }.join
end
@jaehess
jaehess / gist:176422
Created August 27, 2009 16:56
Quicksilver URL Shortener with bit.ly
#!/usr/bin/python
usage = '''
Takes the URL of the frontmost Safari window/tab and
shortens using the service at bit.ly. The shortened
URL is put on the clipboard, ready for pasting.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
</head>
<body>
</body>
dir /a /b c:\windows\$ntuninstallkb* > kbs.txt && for /f %i in (kbs.txt) do cd c:\windows\%i\spuninst && spuninst.exe /passive /norestart && ping -n 15 localhost > nul
<html>
<head>
<title>Fetch Image</title>
<script type="text/javascript" src="index.js"></script>
<link href="index.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<h3>Fetch Image From URL:</h3>
<div style='font-weight:bold'>Title</div>
<input id="imgTitle" type="text"></input>
Titanium.UI.setBackgroundColor('#000');
var tab_group = Ti.UI.createTabGroup();
var win = Titanium.UI.createWindow({ });
win.hideTabBar();
var edit = Titanium.UI.createButton({title:'Move'});
win.setRightNavButton(edit);
var data = [
{title: 'foo'},
@jaehess
jaehess / app.js
Created March 18, 2010 04:30 — forked from noahd1/app.js
Titanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup();
var win = Titanium.UI.createWindow({
title:'Tab',
backgroundColor:'#fff'
});
var tab = Titanium.UI.createTab({
#
# Inspired by
# http://dev.rubyonrails.org/svn/rails/plugins/account_location/lib/account_location.rb
#
module SubdomainAccounts
def self.included( controller )
controller.helper_method(:account_domain, :account_subdomain, :account_url, :current_account, :default_account_subdomain, :default_account_url)
end
protected
/*
* CPNavigationBar.j
* AppKit
*
* Created by Nicholas Small.
* Copyright 2009, 280 North, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
var Person.new();
# person.firstName() returns null
<mx:TextField value="{person.firstName}" />
# lets say you enter "Jae" into the textfield
# person.firstName() would now return Jae