Stories

  • My Player 2.0

    My Player 2.0

    Do you remember My Music Player ? I still hate myspace sites! Unfortunately AppJet hosting go down, but… Heroku comes in. My Player 2.0 is new webapp, is completely written in Ruby and Sinatra framework.
    13 November 2009
  • What's wrong with You merb ?

    What's wrong with You merb ?

    If you get this … FATAL: The gem data_objects (= 0.9.11, runtime), [] was not found … try this …
    23 February 2009
  • Using Mac Sudden Motion Sensor with RubyInline

    Using Mac Sudden Motion Sensor with RubyInline

    Quick and dirt script for reading your macbooks sudden motion sensor: require 'rubygems' require "inline" class SMS class << self inline do |builder| builder.add_compile_flags '-x objective-c', '-framework IOKit' builder.include "&lt;IOKit/IOKitLib.h>" builder.c %q{ VALUE values(){ struct data { unsigned short x; unsigned short y; unsigned short z; char pad[34]; }; kern_return_t result; mach_port_t masterPort; IOMasterPort(MACH_PORT_NULL, &masterPort); CFMutableDictionaryRef matchingDictionary = IOServiceMatching("SMCMotionSensor"); io_iterator_t iterator; result = IOServiceGetMatchingServices(masterPort, matchingDictionary, &iterator); if(result != KERN_SUCCESS) { return rb_str_new2("Error"); } io_object_t device = IOIteratorNext(iterator); IOObjectRelease(iterator); if(device == 0){ return rb_str_new2("Error"); } io_connect_t dataPort; result = IOServiceOpen(device, mach_task_self(), 0, &dataPort); IOObjectRelease(device); if(result != KERN_SUCCESS) { return rb_str_new2("Error"); } IOItemCount structureInputSize; IOByteCount structureOutputSize; struct data inputStructure; struct data outputStructure; structureInputSize = sizeof(struct data); structureOutputSize = sizeof(struct data); memset(&inputStructure, 1, sizeof(inputStructure)); memset(&outputStructure, 0, sizeof(outputStructure)); result = IOConnectMethodStructureIStructureO( dataPort, 5, structureInputSize, &structureOutputSize, &inputStructure, &outputStructure ); if(result != KERN_SUCCESS) { return rb_str_new2("Error"); } IOServiceClose(dataPort); VALUE coords = rb_ary_new2(3); rb_ary_store(coords, 0, INT2FIX(outputStructure.x)); rb_ary_store(coords, 1, INT2FIX(outputStructure.y)); rb_ary_store(coords, 2, INT2FIX(outputStructure.z)); return coords; } } end end end loop do x,y,z = SMS.values puts "#{x} #{y} #{z}" end
    8 December 2008
  • Include helpers in controllers

    Include helpers in controllers

    Yes, I know! Helpers are modules that provide methods which are automatically usable in your view. But sometimes you want to use it in controllers ;) This is my solution. Helpers are available in module named ‘Helpers’, so they don’t brake anything. All rails helpers and named routes are included by default. This is simple usage:
    5 June 2008
  • GEdit With Multi Terminal

    GEdit With Multi Terminal

    GEdit is nice developer editor for GNOME. Textmate like snippets, file browser and embedded terminal. Last one is a nice feature, but default plugin gives you only one terminal. But wait, plugins are written in python. This is my third attempt to modify python code… It was not so bad, after few print(), dir(), and id() I can add and remove terminal windows within gedit :)
    29 March 2008
  • UWA Google Suggest

    UWA Google Suggest

    Google Suggest is now UWA style widget. Check this out.
    14 March 2008
  • Id of nil object

    Id of nil object

    nil.id == 4 # => true Sweet truth ;)
    7 March 2008
  • Generating Methods in Ruby

    Generating Methods in Ruby

    I was trying to find a way for generating dynamic methods. My first attempt was very ugly and use a simple eval:
    29 February 2008
  • My Music Player

    My Music Player

    Another application written in javasctipt, using AppJet solution. This one is simple application for browsing myspace music profiles and listen music. Big different is that you don’t need to wait for whole ugly myspace page. Type band name, click search and press play on player :) Easy ? Take a look under player, there are similar artists. This might be helpful.
    27 February 2008
  • UWA Netvibes Customize

    UWA Netvibes Customize

    Netvibes Customize widget is now available in UWA api. It works only in Netvibes environment, using it in any other just makes no sense ;) If you find any bugs write about it on Netvibes Developers Forum in this thread. I hope you like it.
    18 February 2008
  • UWA Quick Translator

    UWA Quick Translator

    Quick translator is now available on UWA platform. Check it now here. ;)
    18 February 2008
  • Metal Releases ICalendar v2

    Metal Releases ICalendar v2

    Here is new version of icalendar feed. This version is written in javascript. Now is hosted by AppJet. AppJet is the easiest way to create a web app. Just type some code into a box, and we’ll host your app on our servers.
    10 February 2008