Skip to content

Instantly share code, notes, and snippets.

@bytespider
bytespider / LICENSE.txt
Created June 4, 2011 11:46 — forked from 140bytes/LICENSE.txt
140byt.es -- convert string to array of UTF-8 bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
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
@bytespider
bytespider / LICENSE.txt
Created June 14, 2011 10:19 — forked from sebastien-p/LICENSE.txt
JavaScript implementation of the Lempel–Ziv–Welch universal lossless data compression algorithm.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Sebastien P. https://twitter.com/#!/_sebastienp
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
@bytespider
bytespider / boilerplate.coffee
Created July 8, 2011 05:51
jsOAuth boilerplate for PIN based authentication in javascript
openAuthoriseWindow = (url) ->
waitForPin = ->
if wnd.closed
pin = prompt("Please enter your PIN", "")
oauth.setVerifier pin
oauth.fetchAccessToken getSomeData, failureHandler
else
setTimeout waitForPin, 100
wnd = window.open(url, "authorise")
setTimeout waitForPin, 100
@bytespider
bytespider / Route.php
Created August 25, 2011 08:57
Zend Framework Rest Route for "/{api_version}/{controller}/{identifier}/{action}" uri scheme
<?php
class App_Rest_Route extends Zend_Rest_Route
{
public function match($request, $partial = false)
{
if (!$request instanceof Zend_Controller_Request_Http) {
$request = $this->_front->getRequest();
}
$this->_request = $request;
$this->_setRequestKeys();
@bytespider
bytespider / .gitconfig
Created August 27, 2011 09:04
Git config
[color]
status = auto
diff = auto
branch = auto
commit = auto
interactive = auto
ui = true
[color "branch"]
current = yellow reverse
@bytespider
bytespider / LICENSE.txt
Created August 30, 2011 13:11 — forked from stdclass/LICENSE.txt
The Comeback of the BLINK-Tag
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
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
@bytespider
bytespider / LICENSE.txt
Created August 31, 2011 08:18 — forked from 140bytes/LICENSE.txt
UUID generator
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
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
@bytespider
bytespider / boilerplate.js
Created September 1, 2011 16:41
jsOAuth xAuth boilerplate
var oauth = OAuth({
consumerKey: 'MY-CONSUMER-KEY',
consumerSecret: 'MY-CONSUMER-SECRET'
});
oauth.post('https://api.twitter.com/oauth/access_token', {
'x_auth_username': 'DarthVader',
'x_auth_password': 'Luk3i5myS0n',
'x_auth_mode': 'client_auth'
}, successCallback, failureCallback);
@bytespider
bytespider / responsive-context-images.html
Created September 10, 2011 20:57 — forked from vasilisvg/responsive-context-images.html
Responsive context aware images without cookies of server logic
<!doctype html>
<meta charset="UTF-8">
<title>Client side context aware responsive images</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.image-container {
width: 50%;
position: relative;
}
.image-container img {
@bytespider
bytespider / index.html
Created October 25, 2011 11:44
Replace images with hires versions on iPhone4+
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
<style>
html, body { padding: 0; margin: 0; }
</style>
</head>
<body>
<img src="testcardk_320.jpg" data-src="testcardk_640.jpg" width="320">