Skip to content

Instantly share code, notes, and snippets.

@damienklinnert
damienklinnert / gist:2718189
Created May 17, 2012 11:07
wikipedia game bookmarklet
<a href="javascript:(function(){
script = document.createElement( 'script' );
script.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js';
script.onload=releasetheKraken;
document.body.appendChild(script);
function releasetheKraken () {
syntax on
set autoindent
set smartindent
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set nu
call pathogen#infect()
filetype plugin indent on
#!/bin/bash
# vars
SANDBOX_DIR=sandbox
if [[ `which ldd` ]]; then
DEPENDENCY_TOOL=ldd
else
DEPENDENCY_TOOL='otool -L'
fi
@damienklinnert
damienklinnert / ownstep.js
Created July 11, 2012 19:55
basic Step implementation
// this should work and give us 1 to 5
var Step = function (steps) {
// this only works with arrays, @todo better check
if (typeof steps !== 'object') {
return;
}
var currentStep = 0, lastStep = steps.length;
@damienklinnert
damienklinnert / ownstep.js
Created July 11, 2012 19:56
basic Step implementation
// this should work and give us 1 to 5
var Step = function (steps) {
// this only works with arrays, @todo better check
if (typeof steps !== 'object') {
return;
}
var currentStep = 0, lastStep = steps.length;
@damienklinnert
damienklinnert / floating.html
Created July 12, 2012 23:44
a little script to create a input field with floating letters that are flying right in
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>floating search</title>
<style>
*:focus {
outline: 0;
}
* {
@damienklinnert
damienklinnert / notifications.html
Created July 13, 2012 08:52
a simple test for html notifications from html5rocks at http://www.html5rocks.com/en/tutorials/notifications/quick/
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>notifications</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
$(function () {
if (window.webkitNotifications) {
console.log('Notifications are supported!');
@damienklinnert
damienklinnert / example.jade
Created July 13, 2012 12:58
some example jade
!!! 5
html
head
meta(charset='utf-8')
title jadepreview
body
h1 jadepreview
h2
| Converts
a(href='http://jade-lang.com/') jade templates
var code = req.query.code, body = 'client_id=&client_secret=&grant_type=authorization_code&redirect_uri=https://localhost:3000/callback&code=' + code
options = {
method: 'POST',
uri: 'https://alpha.app.net/oauth/access_token',
form: body
};
request.post(options, function (err, res, body) {
console.log(body);
});
AppDotNet
.getUser()
✓ returns a user object (827ms)
✓ returns an error when not authorized (730ms)
.followUser()
✓ returns a user object (835ms)
✓ returns an error when not authorized (747ms)
.unfollowUser()
✓ returns a user object (811ms)
✓ returns an error when not authorized (733ms)