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
INSERT INTO jos_zoo_category_item (category_id, item_id) | |
SELECT 0, id FROM jos_zoo_item |
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 http = require('http'); | |
http.createServer(function(request, response) { | |
var proxy = http.createClient(80, 'google.com'); | |
var url = request.url; | |
console.log(url); |
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
for f in `find . -type f -name '*.php' -print`; do mv $f ${f}~ && tr -d "\r" < ${f}~ >$f; rm ${f}~; done; |
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
// 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 = [ |
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
function cdls { | |
cd $1; | |
ls; | |
} | |
alias cd=cdls |
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
// 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 |
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
{% 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) { |
NewerOlder