Skip to content

Instantly share code, notes, and snippets.

View b1nary's full-sized avatar

Roman Pramberger b1nary

View GitHub Profile
@b1nary
b1nary / setamod.rb
Last active October 12, 2015 22:57
RubyBukkit Colored chat plugin (with uptime lol)
# Display time since server start or reload
Plugin.is {
name "SetaMOD"
version "0.1"
author "Seta"
commands :uptime => {
:usage => "/uptime - display time since server start or reload"
}, :prefix => {
:usage => "/prefix - player prefix"
@b1nary
b1nary / lol.rb
Created November 5, 2012 09:37
messing around with rubys W32 api
#!usr/bin/ruby
require 'Win32API'
require 'open-uri'
require 'win32ole'
require 'win32/registry'
@count = 0
puts "APPDATA: #{ENV['APPDATA']}"
@b1nary
b1nary / _MageJS.md
Created October 14, 2012 06:58
My awesome Game Engine in JS

MageJS

My awesome Game Engine in JS

  • Grown on Modern Browser Standards
  • Aims to be lightweight
  • Modular build

INDEV

@b1nary
b1nary / 4chan.css
Created September 7, 2012 21:18
Not really optimized (even not really beautiful) chan.css
body {
background: none;
background-color: #222;
color: #929492;
font-size:80%;
}
/* General links */
a {
color: #797;
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@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
@b1nary
b1nary / _.md
Created July 7, 2012 17:55
Game of Life / Copyworld / Langton's Ant Simulation in HTML5 Canvas Element
@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 / 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 / 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