Skip to content

Instantly share code, notes, and snippets.

View JosePedroDias's full-sized avatar

José Pedro Dias JosePedroDias

View GitHub Profile
@luciferous
luciferous / README.md
Created September 29, 2012 13:11
Do-notation in Javascript

do.js

An experimental Javascript library that can be used for asynchronous control flow, non-determinism, parsing, and other kinds of computations which implement the interface:

bind :: m a -> (a -> m b) -> m b
return :: a -> m a

This gist is a temporary living situation for do.js, and will most likely be expanded into a full blown Github repository in the future.

@4rn0
4rn0 / gist:3146246
Created July 19, 2012 19:34
Trigger fullscreen HTML5 video on iPad
<!DOCTYPE html>
<html>
<head>
<title>Trigger fullscreen HTML5 video on iPad</title>
<style>
#video { height: 1px; opacity: 0; position: absolute; width: 1px; }
#play { width: 100px; }
</style>
</head>
<body>
@jbroadway
jbroadway / app.js
Created June 27, 2012 18:05
Simple History.js-based client-side router
var app = (function ($) {
var self = {};
// change pages via app.go('/new/page') or app.go(-1)
self.go = function (url) {
if (url === parseInt (url)) {
History.go (url);
} else {
History.pushState (null, null, url);
}
@lg0
lg0 / markdown.xml
Created April 10, 2012 19:58
Markdown Syntax Highlighting for Sublime text 2
<!-- copy this to YOUR_THEME.tmTheme-->
<dict>
<key>name</key>
<string>diff: deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#EAE3CA</string>
@paolorossi
paolorossi / html5-video-streamer.js
Created March 7, 2012 13:21
Node.js HTML5 video streamer
/*
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js
*/
var http = require('http'),
fs = require('fs'),
util = require('util');
http.createServer(function (req, res) {
var path = 'video.mp4';
@henrik
henrik / ocr.markdown
Created March 3, 2012 17:07
OCR on OS X with tesseract

Install ImageMagick for image conversion:

brew install imagemagick

Install tesseract for OCR:

brew install tesseract --all-languages

Or install without --all-languages and install them manually as needed.

@nicerobot
nicerobot / chrome-cookies.sh
Created December 7, 2011 16:59
Convert Google Chrome sqlite Cookies into cookies.txt. Useful for utilities like curl.
sqlite3 -separator ' ' ${COOKIES:-Cookies} \
'select host_key, "TRUE", path, "FALSE", expires_utc, name, value from cookies'
@butaji
butaji / server.hs
Created May 29, 2011 20:27
Simple Haskell web server
import Control.Monad
import Data.Char
import System.IO
import Network
import Data.Time.LocalTime
data RequestType = GET | POST deriving (Show)
data Request = Request { rtype :: RequestType, path :: String, options :: [(String,String)] }
data Response = Response { version :: String, statuscode :: Int }
@bebraw
bebraw / gameengines.md
Created January 6, 2011 18:07
List of JS game engines. You can find a wikified version at https://github.com/bebraw/jswiki/wiki/Game-Engines. Feel free to modify that. I sync it here every once in a while.

IMPORTANT! Remember to check out the wiki page at https://github.com/bebraw/jswiki/wiki/Game-Engines for the most up to date version. There's also a "notes" column in the table but it simply does not fit there... Check out the raw version to see it.

This table contains primarily HTML5 based game engines and frameworks. You might also want to check out the [[Feature Matrix|Game-Engine-Feature-Matrix]], [[Game Resources]] and [[Scene Graphs]].

Name Size (KB) License Type Unit Tests Docs Repository Notes
Akihabara 453 GPL2, MIT Classic Repro no API github Intended for making classic arcade-style games in JS+HTML5
AllBinary Platform Platform Dependent AllBinary 2D/2.5D/3D n
/* For Node.js - resolve a chain of HTTP redirects
Uses getResponse() from http://gist.github.com/399276
Example: resolveHttpRedirects('http://ow.ly/1Kn4j', function(url) { sys.puts(url) });
*/
function resolveHttpRedirects(url, callback, maxnum) {
maxnum = maxnum || 3;
var count = 0;
function next(url) {
getResponse(url, function(response) {