Skip to content

Instantly share code, notes, and snippets.

View b1nary's full-sized avatar

Roman Pramberger b1nary

View GitHub Profile
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{
@b1nary
b1nary / _.md
Created May 1, 2012 21:44
JSP Homework

*O* Homework *O*

Sooo well done!

(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
@b1nary
b1nary / Japanese style
Last active February 11, 2023 00:09 — forked from endolith/Has weird right-to-left characters.txt
Unicode smileys emoticons
⨀_⨀
⨂_⨂
(/◔ ◡ ◔)/
°ﺑ°
(¬_¬)
(´・ω・`)
(ʘ_ʘ)
(ʘ‿ʘ)
(๏̯͡๏ )
(◕_◕)
@b1nary
b1nary / google_speech_recognition.rb
Created June 13, 2012 15:33 — forked from pachacamac/google_speech_recognition.rb
google speech recognition with ruby
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
@b1nary
b1nary / nixcolor.gemspec
Last active October 6, 2015 12:08
NixColor - Yet another 255 Ansi colors for ruby gem
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'
@b1nary
b1nary / result.txt
Created June 27, 2012 13:14
Ruby file serialation Benchmark
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)
@b1nary
b1nary / _.md
Created July 7, 2012 17:55
Game of Life / Copyworld / Langton's Ant Simulation in HTML5 Canvas Element
@b1nary
b1nary / mplayer.rb
Created July 30, 2012 16:08
Control a mplayer slave within ruby
## 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