Skip to content

Instantly share code, notes, and snippets.

View funkatron's full-sized avatar

Ed Finkler funkatron

View GitHub Profile
Spaz.TimelineFilters.defaultEntryFilters = [
{
'label':'nl2br',
'func':function(d) {
d.text = sch.nl2br(d.text);
if (d.SC_is_retweet) {
d.retweeted_status.text = sch.nl2br(d.retweeted_status.text);
}
return d;
}
/**
* Add some custom timeline filters
*
* There are five timeline filter objects:
* - Spaz.TimelineFilters.friends
* - Spaz.TimelineFilters['public']
* - Spaz.TimelineFilters.lists
* - Spaz.TimelineFilters.search
* - Spaz.TimelineFilters.other
*
@funkatron
funkatron / remove-api-rts.js
Created December 6, 2010 17:50
Put this in your user.js file in Spaz Desktop to filter all API RTs out
Spaz.TimelineFilters.friends.addFilter('noAPIRTs', function(d) {
if (d.retweeted_status) { // if a 4sq link is present, remove it
sch.debug('Removing '+d.id+' from results (noAPIRTs)');
d = null;
}
return d;
});
@funkatron
funkatron / recurse.js
Created December 9, 2010 04:04
Recursion on an array of URLs in JavaScript until one succeeds or the end is reached
var urls = [
'http://getspaz.com/nosir!',
'http://funkatron.com/',
'http://getspaz.com/nosir!'
];
var index = 0;
function tryme() {
if (index < urls.length) {
@funkatron
funkatron / SpazDesktopCSSHacks.css
Created December 17, 2010 14:18
Some example CSS Hacks you can use in Spaz Desktop
/* User CSS Overrides */
/* override the status text size */
div.timeline-entry .status-text {
font-size:120%;
}
/* change the font everywhere */
body, div.timeline-entry .status-text {
font-family:Palatino, Georgia, Serif;
@funkatron
funkatron / spaz_filter_rot13.js
Created December 17, 2010 21:35
an almost pointless rot13 filter for Spaz
Spaz.TimelineFilters.friends.addFilter('rot13', function(d) {
function str_rot13 (str) {
// http://kevin.vanzonneveld.net
// + original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
// + improved by: Ates Goral (http://magnetiq.com)
// + bugfixed by: Onno Marsman
// + improved by: Rafał Kukawski (http://blog.kukawski.pl)
// * example 1: str_rot13('Kevin van Zonneveld');
// * returns 1: 'Xriva ina Mbaariryq'
@funkatron
funkatron / usercss-nocollapse-leopaz.css
Created December 27, 2010 15:40
Disables the "collapsing" of read statuses in the Leopaz theme for Spaz Destkop
/**
* This disables collapsing of read statuses in the Leopaz theme as of Monday, December 27, 2010.
* Other themes may or may not work with this override.
*/
div.timeline-entry.read:not(.ui-selected) {
max-height: inherit;
padding:5px;
}
div.timeline-entry.read:not(.ui-selected) div.user {
padding:5px 5px 0 0;
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
if (typeof(obj[prop]) != 'function') {
sch.error('obj.'+prop+' ('+typeof(obj[prop])+') : '+obj[prop]);
} else {
sch.error('obj.'+prop+' ('+typeof(obj[prop])+')');
}
}
}
@funkatron
funkatron / redesign-idea2.html
Created January 7, 2011 17:39
shows some super fancy text kerning and positioning and shit. Uses jquery.lettering.js
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Page Title</title>
<link href='http://fonts.googleapis.com/css?family=Cardo:regular"' rel='stylesheet' type='text/css'>
<style type="text/css" media="screen">
BODY {
background-color:#999;
font-family:Cardo;
var resizeHandle = document.getElementById('resize-se');
resizeHandle.addEventListener('mousedown', function (e){
var isDragging = true;
var mousePosition = {x:event.clientX, y:event.clientY};
document.addEventListener('mousemove', drag, false);
document.addEventListener('mouseup', function (e){
document.removeEventListener('mousemove', drag, false);
document.removeEventListener('mouseup', arguments.callee, false);