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
# see http://wiki.alcidesfonseca.com/blog/casual-programming/ | |
# if no wget (as in mac 10.3) curl can be used | |
import os | |
for line in open("index.m3u"): | |
os.system("curl -O %s" % line) |
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
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths")) | |
# Commonly used webrat steps | |
# http://github.com/brynary/webrat | |
Given /^Debug$/ do | |
puts response_body | |
filepath = '/tmp/webrat_debug.html' | |
File.open(filepath, "w") do |file| |
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
#!/bin/sh | |
# Run all cucumber tests in app cucumber/features directory every n seconds | |
# Usage | |
# ./autotest.sh <loop time seconds> | |
# ./autotest.sh 15 | |
# assumes test is in cucumber/features | |
# and cucumber dir in same dir as this file | |
check() { |
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
# see http://www.theautomatedtester.co.uk/seleniumtraining/selenium_rc_setup.htm | |
# java -jar selenium-server.jar -htmlSuite *firefox <start URL> <name of the file you load into the IDE> <file you want to save the results in> | |
java -jar selenium-server.jar -htmlsuite *firefox http://www.theautomatedtester.co.uk /Applications/MAMP/htdocs/selenium-remote-control-1/examples/testsuite/testsuite.html /Applications/MAMP/htdocs/selenium-remote-control-1/examples/testsuite/results.html |
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
+-------+ 1 0..* +-------+ | |
| Class | ---------> | Style | | |
+-------+ +-------+ | |
+-------+ 1 1 +-----------+ | |
| Class | <---------> | HashTable | | |
+-------+ | -- | | |
| metadata | | |
+-----------+ |
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
var sys = require('sys'), | |
fs = require('fs'), | |
Url = require('url'), | |
http = require('http'), | |
querystring = require('querystring'); | |
//create a Heatmap Obj that inherits | |
//from EventEmitter | |
var events = require('events'); |
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
//responds to request when new click is sent | |
//to /addDataPoint, otherwise hangs | |
var displayNewDataPoints = function(req, res) { | |
MyHeatmap.on('added', function(dt) { | |
//print client side js so client heatmap | |
//display functions are called | |
//and recall this url again | |
var str = 'xx.addDataPoint('+dt.x+","+dt.y+');'; | |
str += 'ajad_send(nurl);'; | |
res.write(str,'utf8'); |
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
#fix httpauth when php as cgi | |
RewriteCond %{HTTP:Authorization} ^Basic.* | |
RewriteCond $1 !^(index\.php|public|images|robots\.txt|css) | |
RewriteRule ^(.*)$ index.php/$1?Authorization=%{HTTP:Authorization} [L,QSA] |
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
if (typeof JE === 'undefined') { | |
JE = {}; | |
} | |
/* | |
* Usage: | |
* agenda = JE.events.controller.init(); | |
* Controller inits events, gets data from model, model on success updates view | |
*/ | |
JE.events = (function() { | |
// Create closure |
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
//detect when user has scrolled to end of content | |
//that is to be loaded using an infinite scroll pattern | |
//no need for plugin | |
$(window).scroll(function(){ | |
var bottomList = $("#item_at_bottom_of_list"); | |
var viewTop = $( window ).scrollTop(); | |
var viewBottom = (viewTop + $( window ).height()); | |
var absoluteBottomList = Math.floor(bottomList.offset().top + bottomList.height()); | |
var scrollBuffer = 150; | |
if ((absoluteBottomList - scrollBuffer) <= viewBottom){ |
OlderNewer