Skip to content

Instantly share code, notes, and snippets.

View paul-english's full-sized avatar

Paul English paul-english

View GitHub Profile
@paul-english
paul-english / zoo-items-frontpage.sql
Created March 1, 2011 17:05
Set all Zoo Items to frontpage
INSERT INTO jos_zoo_category_item (category_id, item_id)
SELECT 0, id FROM jos_zoo_item
var http = require('http');
http.createServer(function(request, response) {
var proxy = http.createClient(80, 'google.com');
var url = request.url;
console.log(url);
@paul-english
paul-english / kill-cr.sh
Created February 2, 2011 21:19
Kills carriage returns for all PHP files in current directory
for f in `find . -type f -name '*.php' -print`; do mv $f ${f}~ && tr -d "\r" < ${f}~ >$f; rm ${f}~; done;
// Firstleft build script ~nrub
//
// 1) installs all necessary node libraries
// 2) copies conf files to appropriate etc directories
// 3) restarts running application server
// 4) runs tests
var run = require('run').run;
var npmPackages = [
function cdls {
cd $1;
ls;
}
alias cd=cdls
// helper function that goes inside your socket connection
client.connectSession = function(fn) {
var cookie = client.request.headers.cookie;
var sid = unescape(cookie.match(/connect\.sid=([^;]+)/)[1]);
redis.get(sid, function(err, data) {
fn(err, JSON.parse(data));
});
};
// usage
{% wire id="more-results" action={moreresults result=result target="list-articles" template="_article_summary.tpl"} %}
<p style="display:none;"><a href="javascript:void(0);" id="more-results">More results...</a></p>
<script>
$(function() {
// PE - this is all a hack, anyone know a better way to do this?
var firedOnce = false;
$(document).scroll(function(e) {
if ($(window).scrollTop() >= $(document).height() - $(window).height() - 200) {