Skip to content

Instantly share code, notes, and snippets.

@slackorama
slackorama / test.html
Created May 8, 2009 20:59
create a grid inside of tab using the onShow event of the tab
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<script src="/js/dojo/dojo.js" djConfig="parseOnLoad:true"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.3.0/dojo/resources/dojo.cs" type="text/css"
media="screen" />
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.3.0/dijit/themes/tundra/tundra.css"
type="text/css" media="screen" />
<link rel="stylesheet"
@slackorama
slackorama / store.js
Created May 21, 2009 00:04
set properties on a store from returned data
dojo.require('dojo.data.ItemFileReadStore');
// get items from the returned data...is there a better way?
dojo.declare( 'MyDataStore', dojo.data.ItemFileWriteStore, {
_getItemsFromLoadedData: function(dataObject) {
this.totalCount = dataObject.totalCount;
this.inherited(arguemnts);
}
});
var data = { identifier: "id",
@slackorama
slackorama / awful.js
Created May 28, 2009 23:58
Awful or ok?
// ternary to the nth degree
s+='<span class="cpointer '+(
t==='date' || t==='time' || t==='year' || t==='quarter' || t==='month' || t==='week'?
val===5201 || val===1028 || val===1128 ?'purple':'dark_purple':
t==='percent'?'blue':
t==='id'?'grey_blue':
t==='aid'?'green':
t==='a'?'dark_green':
t==='anumber'?'darker_green':
'')+'" onclick="ck(event);'+this.tt+'.ck_filter('+pane_id+','+fe_count+',1)"><input type="checkbox" name="f'+val+'"'+(checked[val]||'')+'> '+title+'</span><br/>'
@slackorama
slackorama / yql-example-rss.sql
Created June 3, 2009 17:38
yql example to grab certain authors from feed
select *
from rss
where url = 'http://www.skineart.com/feed'
and creator in ('BoboMonkey',
'Joseph R Tomlinson');
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>testing</title>
<meta name="author" content="Seth Mason">
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<style type="text/css">
@import "/js/dijit/themes/tundra/tundra.css";
@import "/js/dojo/resources/dojo.css";
@slackorama
slackorama / gist:134919
Created June 23, 2009 23:50
check to see if item exists in store and insert it.
function processData(item, request){
var value = myStore.getValue(item, 'group');
var exist = myStore.getValue(item, value);
var child = myStore.getValue(item, "name");
console.debug(exist);
if (undefined == exist){
console.debug(exist + " Create " + value + " " + child);
myStore.newItem({name: value, children:[{_reference: [child]}]});
myStore.save;
}
@slackorama
slackorama / change-tooltip.html
Created June 24, 2009 19:35
change a tooltip text programatically
<html>
<head>
<title>Tooltip Demo</title>
<style type="text/css">
@import "http://ajax.googleapis.com/ajax/libs/dojo/1.3/dojo/resources/dojo.css";
@import "http://ajax.googleapis.com/ajax/libs/dojo/1.3/dijit/themes/tundra/tundra.css";
</style>
// from
// http://stackoverflow.com/questions/1100066/filter-table-from-select-input-using-jquery/1100201
//
// basically, filter a table on a page based on rows chosen from a dropdown
$('select').change( function(e) {
var letter = $(this).val();
$('tr').each( function(rowIdx,tr) {
$(this).hide().find('td').each( function(idx, td) {
if( idx === 0 || idx === 1) {
#!/bin/sh
# rtm - simply use twitter to send off a direct message to rtm to add a task
username=$1
shift
password=$2
shift
curl -s --basic --user "$username:$password" --data-ascii \
@slackorama
slackorama / *scratch*
Created January 16, 2010 00:49
My .gitconfig aliases
[alias]
st = status
ci = commit
br = branch
co = checkout
df = diff
lg = log -p
lol = log --pretty=oneline --abbrev-commit --graph --decorate
unstage = reset HEAD
who = shortlog -s --