A ~400LOC transcompiler transforming a subset of Ruby to JavaScript.
curl https://raw.github.com/gist/2017173/efebd33d6ff430347ddb953c587318c8934cfd1e/rubyscript.rb > rubyscript
chmod +x rubyscript
./rubyscript my_file.rb > my_file.js
| var p1 = { | |
| x: 20, | |
| y: 20 | |
| }; | |
| var p2 = { | |
| x: 40, | |
| y: 40 | |
| }; |
| (function(){ | |
| var set = function(obj, prop, val){ | |
| Object.defineProperty(obj,prop,{ | |
| value : val | |
| }) | |
| return val; | |
| }; |
| /** | |
| * Enable route to __noSuchMethod__ when unknown method calling. | |
| * | |
| * @param {Object} obj Target object. | |
| * @return {Object} | |
| */ | |
| function enableMethodMissing(obj) { | |
| var functionHandler = createBaseHandler({}); | |
| functionHandler.get = function(receiver, name) { |
| # Copyright Camptocamp SA 2012 | |
| # License: AGPL (GNU Affero General Public License)[http://www.gnu.org/licenses/agpl-3.0.txt] | |
| # Author Guewen Baconnier | |
| require "xmlrpc/client" | |
| require 'pp' | |
| XMLRPC::Config::ENABLE_NIL_PARSER = true | |
| XMLRPC::Config::ENABLE_NIL_CREATE = true | |
| class MagentoAPI |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| #!/bin/bash | |
| # /etc/init.d/xvfb_daemon | |
| # Xvfb startup script. | |
| # Tom Meier <[email protected]> | |
| # | |
| ### BEGIN INIT INFO | |
| # Provides: xvfb | |
| # Short-Description: Start/stop/restart daemon | |
| # Description: Controls the Xvfb daemon which starts/stops the X Virtual Framebuffer server | |
| # Example Use: |
| #!/bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: unicorn | |
| # Required-Start: $local_fs $remote_fs mysql | |
| # Required-Stop: $local_fs $remote_fs | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: unicorn initscript | |
| # Description: Unicorn is an HTTP server for Rack application | |
| ### END INIT INFO |