Skip to content

Instantly share code, notes, and snippets.

View TBD's full-sized avatar
💭
working

TBD TBD

💭
working
View GitHub Profile
@TBD
TBD / index.html
Created June 6, 2012 18:07
Prezi Compo entry - 662 bytes
<style>body{overflow:hidden}z{display:none}w{position:absolute;top:50%;margin:0 auto;width:100%;text-align:center}</style><z><x>hello world</x><x>simple presentation tool</x><x>one feature:</x><x>zoom</x><x>by TBD/plugins.ro</x></z><w id='s'></u><script>b=1;c=0;d=8;e=document.getElementsByTagName("x");l="fffeeebbbaaa888444222000";function r(){if(b>d)c+=1,b=1;else if(b<0)c-=1,b=d;if(b<d)s.innerHTML=e[c].innerHTML;x=s.style;x.MozTransform=x['-webkit-transform']="scale("+b+")";x['color']='#'+l.substr(3*b,3)}t=function(e){m=e.wheelDeltaY||-e.detail;g=m&&m/Math.abs(m);b+=0.3*g;r()};q=window.addEventListener;q('mousewheel',t,0);q('DOMMouseScroll',t,0)</script>
@TBD
TBD / inject.js
Created March 11, 2012 19:11
browsing tools dotjs snippets
// --- requirement:
// --- dotjs - http://defunkt.io/dotjs/
// --- forrst.com
// --- click for next page
$("#content").click(function(){
var href = $('.pagination a').attr('href');
if (href && href != document.location)
document.location = href;
@TBD
TBD / makeLink.js
Created February 24, 2012 12:06
Crude javascript create link
@TBD
TBD / sublime.txt
Created January 7, 2012 19:58
run Sublime unde GDB
> gdb "/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2"
gdb$ r
: to exit
gdb$ q
@TBD
TBD / server.rb
Created December 16, 2011 01:47
omniauth using google openid
# 502 errors on CloudFoundry due use of Rack::Session::Cookie (and sessions enabled)
require 'rubygems'
require 'sinatra'
require 'omniauth'
require 'omniauth-openid'
require 'openid/store/filesystem'
enable :sessions
@TBD
TBD / test.coffee
Created October 31, 2011 22:55
ducksboard
_data = '{"timestamp": 1320099130, "value": {"title": "msg", "content": "hello world"}}'
msg.http('https://push.ducksboard.com/')
.path('/values/10651/')
.auth(_apikey,"ignored")
.post(_data) (err, res, body) ->
msg.send body || 'unable to post'
@TBD
TBD / fetch_test.rb
Created October 19, 2011 18:18
FetchApp error
require 'rubygems'
require 'fetchapi-ruby'
# custom info sanitized
FetchAPI::Base.basic_auth('*URL*', '*key*', '*token*')
orders = FetchAPI::Order.find(:all)
orders.each do |order|
p order.downloads
end
@TBD
TBD / gist:1042033
Created June 23, 2011 06:36
github.mac 2 errors
2 errors when I use Github.Mac
* press Clone in Mac and after cloning (i see the files in the dir) I get:
(
0 GitHub 0x00000001000755dc -[GHApplication presentError:] + 313
1 GitHub 0x0000000100018817 __62-[GHCachedStateManager cloneAndAddRepository:atURL:toFileURL:]_block_invoke_0292 + 66
2 libSystem.B.dylib 0x00007fff85bab284 _dispatch_call_block_and_release + 15
3 libSystem.B.dylib 0x00007fff85b89df2 _dispatch_queue_drain + 251
4 libSystem.B.dylib 0x00007fff85b8a69f _dispatch_queue_serial_drain_till_empty + 9
5 libSystem.B.dylib 0x00007fff85bbd43c _dispatch_main_queue_callback_4CF + 37
@TBD
TBD / gist:1028310
Created June 15, 2011 22:47
open Adium from Albert
steps:
1) open Apple Script Editor
2) paste and save:
on run argv
tell application "Adium"
activate
try
set usr to first contact whose display name contains (item 1 of argv)
set nme to name of usr
@TBD
TBD / flexiDROID.htm
Created May 3, 2011 23:02
JS1k winner by @KeenBlaze unpacked by @tbdr
<html>
<head>
<title>JS1k, 1k demo submission [984]</title>
<meta charset="utf-8">
</head>
<body marginwidth="0" marginheight="0">
<canvas id="c" width="1000" height="800"></canvas>
<script>
var b = document.body;
var c = document.getElementsByTagName('canvas')[0];