Skip to content

Instantly share code, notes, and snippets.

View mrspeaker's full-sized avatar

Mr Speaker mrspeaker

View GitHub Profile
@mrspeaker
mrspeaker / gist:2105288
Created March 19, 2012 09:35
JavaScript merge sort
function merge(a, b, c) {
c = c || [];
if(!a.length && !b.length) return c;
c.push(a[0] < b[0] || isNaN(b[0]) ? a.shift() : b.shift());
return merge(a, b, c);
}
function msort(inp) {
var mid = (inp.length / 2) << 0;
@mrspeaker
mrspeaker / everyexampleoutthere.m
Created May 30, 2012 08:45
One multipart boundary to rule them all
NSString *boundary = @"---------------------------14737809831466499882746641449";
NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary];
@mrspeaker
mrspeaker / AA.md
Created July 10, 2012 08:23 — forked from sadache/AA.md
Is socket.push(bytes) all what you need to program Realtime Web apps?

Is socket.push(bytes) all you need to program Realtime Web apps?

One of the goals of Play2 architecture is to provide a programming model for what is called Realtime Web Applications.

Realtime Web Applications

Realtime Web Applications are applications that make use of Websockets, Server Sent Events, Comet or other protocols offering/simulating an open socket between the browser and the server for continuous communication. Basically, these applications let users work with information as it is published - without having to periodically ping the service.

There are quite a few web frameworks that target the development of this type of application: but usually the solution is to simply provide an API that allows developers to push/receive messages from/to an open channel, something like:

# MAC manipulators
alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`'
alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE'
{
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It
is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as
you did, the {internet|net|web} will be {much more|a lot more}
useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch}
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any?
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe.
Thanks.|
@mrspeaker
mrspeaker / Gruntfile.js
Created July 29, 2013 08:55
Grunt file for Auto-exporting Pixelmator saving, with project reload
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
src: {
files : ['digibots/res/**/*.{png,jpg,jpeg,gif}', 'digibots/scripts/**/*.js', 'digibots/index.html'],
options : {
@mrspeaker
mrspeaker / ld27-themes
Last active December 21, 2015 14:09
LD27 final round - rated by round score
# LD27 themes
- 10 Seconds +748 1423 354 675
- Death is useful +426 1278 443 852
- Connections +238 975 674 737
- Corruption +159 1004 564 845
- Space +117 1039 473 922
- Alternative Reality +117 1085 491 968
- Alchemy +115 993 539 878
- Machines +96 972 567 876
@mrspeaker
mrspeaker / contact
Created November 26, 2013 11:20
Contact Info
Send me an email.... send me and email... right now...
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBFKUfXoBEADFsoCic4SBIRv4LU8YpviPZnc3sgMR26kmtC4kPTjR3QEfbE50
V/0hIvZPPEJZM5KTYH4hc5DaMFhTB/qQnX7DJU3ji23aoNDJIJSvqIwm2n9GdrJn
zTnQNbVKpcAzS9oLhl0U57IMZ5pKUr+jRl1yuF/TZXX5SdaSO21YvXp9D70T4p5y
/UwiQeni+fqBcurFCo9TruPijBVM5uq+G3hVblTWrD9rM/NJQb+lBv/3EzGpnLWJ
OSICfOrOPiIZqBKCW5cyzgpP5PTxdxOTEjxpV72WS2zjbBm6YRYmKhG/ppEhkORN
nqP/qF9ck7kUPXau7kgLLI6gnEletyG7kfaMe9Jp5aSyiDkpsQP3V3Nht+xnXAht
@mrspeaker
mrspeaker / ld-voting-results.md
Last active May 15, 2016 17:19
Results of Ludum Dare round-by-round voting.

LD voting

LD28

LD28 Theme Voting – Round 5 of 5

[Stay tuned! Oh, the excitement!]

LD28 Theme Voting – Round 1 of 5

@mrspeaker
mrspeaker / gist:11379979
Created April 28, 2014 18:24
create movie from multiple png files
# script to create movie from multiple png files
dir=${1-"timelapse"}
cd $dir;
echo "Creating symlinks...";
# start at 0
count=0