Skip to content

Instantly share code, notes, and snippets.

@cianclarke
cianclarke / trendyJSHotlink.html
Created August 1, 2011 14:33
Hotlink Trendy.JS
@cianclarke
cianclarke / initializeTrendy.js
Created August 1, 2011 14:39
Initialize Trendy.html
<script type="text/javascript">
// Optional functionality - a warning and an error div, can be one the same.
var trendyOptions = {
status: '#status',
warning: '#warning'
}
// Initialize trendy with a container of ID 'tweetContainer', with our options object
$t.init('#tweetContainer', trendyOptions);
</script>
@cianclarke
cianclarke / startTrendySearch.html
Created August 1, 2011 14:44
Start a Trendy.js streaming search
<!-- we start a search with $t.search('something');
we're going to attach this functionality to a HTML input -->
Search Value: <input type="text" name="query" id='searchQuery'>
<input type="submit" value="Submit" onclick="$t.search(document.getElementById('searchQuery').value);">
@cianclarke
cianclarke / dust.js
Created February 9, 2012 17:38
New dust.js module (eventually fork / pullrequest this)
var fs = require('fs'),
fsPath = require('path'),
http = require('http'),
dust = require('dust'),
baseContext = dust.makeBase({}),
viewDir = "views";
var mix = function(s, d) {
@cianclarke
cianclarke / ajaxify.js
Created June 22, 2012 16:19
fh-studio single page navigation example
// attach an event handler to all links with the singlepage class, that is all links we want to not do a full page nav
// where possible
$('a.singlepage').click(function(e){
e.preventDefault();
var url = $(this).attr('href'),
// Continue as normal for cmd clicks etc
if ( event.which == 2 || event.metaKey || url==="#" || !url ) { return true; }
// Now do a call to our JSON API made by Express.
3.0 kg. Light DME
340g. Crystal Malt
14g. Chinook (Whole, 13.3 %AA) 60 min.
12g. Chinook (Whole, 13.3 %AA) 30 min
16g. Columbus (16.1 %AA) boiled 10 min
58 g. Columbus (16.1 %AA) boiled 0 min
Yeast : SO-05
var neverGonna = ["give you up", "let you down", "run around and desert you", "make you cry", "say goodbye", "tell a lie and hurt you"];
for (var i=0; i<neverGonna.length; i++){
console.log("Never gonna " + neverGonna[i]);
}
@cianclarke
cianclarke / build.sh
Created August 15, 2012 16:57
A typical build file for a feedhenry app project
#! /bin/bash
cd cloud
echo 'Installing dependencies'
npm install -d --force
export NODE_PATH=$PWD
echo 'Running npm test'
npm test
cd ..
@cianclarke
cianclarke / tweet.entities.media for Instagram etc..
Created August 15, 2012 23:35
Append the image URL for posts from Instagram and Tumblr to a tweet's entities
var imageController,
util = require("util"),
request = require("request");
imageController = {
checkForTweetUrlMedia: function (tweet, callback) {
var url = (tweet.entities && tweet.entities.urls && tweet.entities.urls.length>0) ? tweet.entities.urls[0].expanded_url : false,
rex = false,
matchAt = 1;
@cianclarke
cianclarke / gist:3858692
Created October 9, 2012 13:04
There's got to be a better way..!
/* iOS6 hardware acceleration */
* {
-webkit-transform: translateZ(0);
-webkit-perspective: 1000;
-webkit-backface-visibility: hidden;
}