This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ch.seta.awsomepixelship; | |
import java.io.IOException; | |
import java.util.Random; | |
import javax.microedition.lcdui.Canvas; | |
import javax.microedition.lcdui.Graphics; | |
import javax.microedition.lcdui.Image; | |
public class ActionCanvas extends Canvas implements Runnable{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in |
Inspired from {this gist}[https://gist.github.com/1134309/1df8c60c1f3cd10d3c40895af195f86c20a75827]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
⨀_⨀ | |
⨂_⨂ | |
(/◔ ◡ ◔)/ | |
°ﺑ° | |
(¬_¬) | |
(´・ω・`) | |
(ʘ_ʘ) | |
(ʘ‿ʘ) | |
(๏̯͡๏ ) | |
(◕_◕) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rest_client' | |
require 'json' | |
a = `sox -d --norm -t .flac - silence -l 1 0 1% 1 6.0 1% rate 16k` | |
#a = `arecord -q -d 3 -c 1 -f S16_LE -r 22050 -t wav | flac - -f --totally-silent -o-` | |
r = RestClient.post 'https://www.google.com/speech-api/v1/recognize?lang=en-US', a, | |
:content_type => 'audio/x-flac; rate=16000' | |
if j = JSON.parse(r) | |
(p j; `espeak 'you said: #{j['hypotheses'].first['utterance']}'`) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gem::Specification.new do |s| | |
s.name = 'nixcolor' | |
s.version = '0.0.2' | |
s.date = '2012-05-30' | |
s.summary = "Unix (Ansi) color gem" | |
s.description = "Yet another 255 Ansi colors for ruby gem" | |
s.authors = ["Roman Pramberger"] | |
s.email = '*@gmail.com' | |
s.files = ["lib/nixcolor.rb"] | |
s.homepage = 'http://rubygems.org/gems/nixcolor' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. YAML: Default Ruby implementation | |
2. JSON: 'json' gem | |
3. XML: 'xml-simple' gem | |
3. Mar.: Marshal (internal) | |
Test 1.: Data Hash | |
user system total real | |
YAML: 2.170000 0.040000 2.210000 ( 2.226518) | |
JSON: 0.030000 0.000000 0.030000 ( 0.037047) |
Using HTML5 Canvas to make awesome life Simulation with a very nice performance (atleast in Chromium)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Mplayer controlling class | |
# | |
# Initialize with music file | |
# Good Slave reference: | |
# https://github.com/CodeMonkeySteve/ruby-mplayer/blob/master/docs/mplayer-slave.txt | |
# | |
# License: WTFPL | |
# | |
class MPlayer |