Skip to content

Instantly share code, notes, and snippets.

View jed's full-sized avatar

Jed Schmidt jed

View GitHub Profile
<!-- in response to http://twitter.com/cramforce/status/57406808142266369 -->
<html>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script>
function getFollowers( name, cb ) {
var obj = {}
jQuery.getJSON(
"https://api.twitter.com/1/followers/ids.json?screen_name=" + name + "&callback=?", cb
@jed
jed / output.txt
Created April 18, 2011 03:43
"TypeError: Cannot convert object to primitive value"
$ node test.js
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Cannot convert object to primitive value
at String.STRING_ADD_LEFT (native)
at isRegExp (util.js:287:14)
at format (util.js:184:11)
at util.js:216:19
> Object.keys(global)
[ 'global',
'process',
'GLOBAL',
'root',
'Buffer',
'setTimeout',
'setInterval',
'clearTimeout',
'clearInterval',
@jed
jed / tweetToHTML.js
Created April 21, 2011 10:57
turning a tweet into html
function htmlify( tweet ) {
return tweet.replace(
/[@]+([A-Za-z0-9-_]+)|[#]+([A-Za-z0-9-_]+)|(\b(?:https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig,
function( match, user, tag, url ) {
return 0,
user ? "@" + user.link( "http://twitter.com/" + user ) :
tag ? "#" + tag.link( "http://search.twitter.com/search?q=%23" + tag ) :
url ? url.split( "//" )[ 1 ].link( url ) : ""
})
}
@jed
jed / bookmarklet.js
Created April 28, 2011 08:57
dom tree caching performance: array v. linked list. see also: http://jsperf.com/dom-trees/
javascript:with(document)(body.appendChild(createElement('script')).src='https://gist.github.com/raw/946036/8b51f04a6f9dbe15f5c375ac872a9ae56d4b8732/domTrees.js')._
@jed
jed / koichi.coffee
Created May 5, 2011 17:11
an effort to replace koichi's outdated XML sig
class Component
constructor: ( @name ) ->
@fullname = "Koichi Kobayashi"
@email = "#{name}@___________.jp"
@blog = "http://d.hatena.ne.jp/#{name}"
@twitter = "http://twitter.com/#{name}"
new Component "koichik"
@jed
jed / LICENSE.txt
Created May 9, 2011 16:17 — forked from 140bytes/LICENSE.txt
communicate with jsonp
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@jed
jed / LICENSE.txt
Created May 9, 2011 16:22 — forked from 140bytes/LICENSE.txt
linkify @mentions and #hashtags in a tweet
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@jed
jed / LICENSE.txt
Created May 10, 2011 14:44 — forked from 140bytes/LICENSE.txt
route client urls with 404s and pattern captures
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@jed
jed / LICENSE.txt
Created May 10, 2011 16:04 — forked from 140bytes/LICENSE.txt
write contextual templates
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE