Skip to content

Instantly share code, notes, and snippets.

View chardcastle's full-sized avatar

Chris Hardcastle chardcastle

  • London (England)
View GitHub Profile
@chardcastle
chardcastle / couchdb_reader.html
Created December 6, 2010 23:15
Uses JQuery and a little HTML to run records from a CouchDB instance like a slide show.
<!Doctype html>
<html>
<head>
<script type="text/javascript" src="http://google.com/jsapi"></script>
<script type="text/javascript">
google.load('jquery','1.3.2')
</script>
</head>
<style type="text/css">
#thumb{
@chardcastle
chardcastle / move-files-into-folder.bash
Created July 31, 2010 20:07
Move files on condition - linux line command
find ./ -name "*.css" -print0 | xargs -0 -I xxx mv xxx css/
@chardcastle
chardcastle / jQuery image pre-load
Created July 5, 2010 22:26
Image preloading in JQuery
/*
* Written by Chris Hardcastle
* Pre-load an image using jQuery
* Example HTML layout
<div id="globalInner">
<div id="loading"><!-- css loading gif --></div>
<div id="stage"></div>
</div>
*/
/*
@chardcastle
chardcastle / toggle-selected-link-in-pagination.js
Created May 18, 2010 22:57
Toggle selected link in pagination - JQuery
@chardcastle
chardcastle / Kohana cron.php
Created May 17, 2010 22:44
My cron file for kohana 2.3.4
<?php
/**
* Created by Chris Hardcastle to run cron jobs
* Based on the default kohana 2.3.4 index.php
* Note the required #! stated above
* CRON TAB USAGE (To run twice a day)
0 0,12 * * * /usr/bin/php [root][site]/cron.php --controller --method
*
* Use the shebang --> #!/usr/bin/php (should you need it, thanks @spolster)
*/