Skip to content

Instantly share code, notes, and snippets.

ruleset a60x226 {
meta {
name "array inside an array"
description <<
for devex question
>>
author "Mike Grace"
logging on
}
ruleset a60x262 {
meta {
name "talkative rules"
description <<
talkative rules
>>
author "Mike Grace"
logging on
}
@MikeGrace
MikeGrace / fire-kynetx-rule-on-search.js
Created June 11, 2010 05:22
Kynetx app that pulls search term from URL on pageview for Devex question
ruleset a60x267 {
meta {
name "Fire rule on search"
description <<
Fire rule on search
>>
author "Mike Grace"
logging on
}
@MikeGrace
MikeGrace / krl-commit-with-growl-notification.sh
Created June 14, 2010 04:43
Shell script sets up bash .profile to show growl notification on 'krl commit'
#!/bin/bash
# Copyright 2010 Michael Grace
# http://geek.michaelgrace.org
# Created 06/13/2010
clear
echo "Script created by Mike Grace http://www.google.com/profiles/themikegrace"
echo "========================================================================"
echo ""
# check if script is run as root or with sudo
# Use growlnotify to alert user of commit status
krl() {
if [[ $@ == "commit" ]]; then
command krl commit | tee status.txt | growlnotify -t "KRL" --image /kynetx-x.png;
cat status.txt;
else
command krl $@
fi;
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>saveActiveFile</string>
<key>bundleUUID</key>
<string>AAB4FD74-73F9-11D9-B89A-000D93589AF6</string>
<key>command</key>
<string>growlnotify -t "TextMate" -m "committing code" -a "TextMate"
@MikeGrace
MikeGrace / kynetx-click-event.krl.js
Created June 21, 2010 22:11
Testing click events on id and class elements and figuring out how click event handling works in KRL
ruleset a60x274 {
meta {
name "click event"
description <<
Testing click events on id and class elements and figuring out how click event handling works in KRL
>>
author "Mike Grace"
logging on
}
@MikeGrace
MikeGrace / testing-jquery-each-function.js
Created June 21, 2010 22:34
Testing jQuery's each function in firebug console
test = [1,2,3,4,5];
$K(test).each(function() {
console.log(this + 1);
})
@MikeGrace
MikeGrace / kynetx-set-entity-var-on-click.krl.js
Created June 22, 2010 03:05
- Testing to see how to set entity variables on KRL click events - App can be run on different pages at different times and the click count will be saved
ruleset a60x275 {
meta {
name "Set entity var on click event"
description <<
- Testing to see how to set entity variables on KRL click events
- App can be run on different pages at different times and the click count will be saved
>>
author "Mike Grace"
logging on
}
@MikeGrace
MikeGrace / default-params.js
Created July 14, 2010 17:52
Faking default param passing in JavaScript function
function defaultParams(name, class, id) {
if (class == null) class = "CS 101 [default]";
if (id == null) id = "Not yet set";
return "Name: " + name + ", Class: " + class + ", ID: " + id;
}