Oct 16 2010
- 04/10/2011 - Updated application.js and application.rb thanks to @rebo's comments
In this article, I will walk through some simple steps to get a [demo app][2] up and running with [Backbone.js][3] and [Sinatra][4] on [Heroku][5].
# download latest libevent2 and tmux sources, and extract them somewhere | |
# (thx bluejedi for tip on latest tmux URL) | |
# | |
# at the time of writing: | |
# https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz | |
# http://sourceforge.net/projects/tmux/files/latest/download?source=files | |
# | |
# install deps | |
yum install gcc kernel-devel make ncurses-devel |
import org.vertx.groovy.core.Vertx | |
class BootStrap { | |
def init = { servletContext -> | |
def vertx = Vertx.newVertx() | |
def httpServer = vertx.createHttpServer() | |
vertx.createSockJSServer(httpServer).installApp(prefix: '/events') { sock -> | |
sock.dataHandler { buff -> | |
sock << buff |
# Install tmux on Centos release 6.5 | |
# http://superuser.com/questions/738829/attempting-to-install-tmux-on-centos-6-4-or-centos-6-5-fails-with-error-evbuff | |
# | |
# READ THIS FIRST!!! | |
# MAKE SURE YOU HAVE BUILD TOOLS/COMPILERS TO BUILD STUFF FROM SOURCES | |
# yum groupinstall "Development Tools" | |
# CD TO TEMPORARY DIRECTORY |
ar http = require('http'); | |
var fs = require('fs'); | |
var util = require('util'); | |
var fileCache; | |
var sendFile = function(conn, file) { | |
conn.writeHead(200, {"Content-Type": "text/html", "Content-Length": file.length}); | |
conn.write(file); | |
conn.end(); | |
} |
@Grapes([ | |
@Grab("org.gebish:geb-core:3.0"), | |
@Grab('io.github.bonigarcia:webdrivermanager:3.4.0'), | |
@Grab('org.seleniumhq.selenium:selenium-chrome-driver:3.141.0'), | |
]) | |
import io.github.bonigarcia.wdm.WebDriverManager | |
import org.openqa.selenium.chrome.ChromeDriver | |
WebDriverManager.chromedriver().setup() |
defmodule Sudoku do | |
def solve do | |
sudoku = [ | |
[5, 3, :_, :_, 7, :_, :_, :_, :_], | |
[6, :_, :_, 1, 9, 5, :_, :_, :_], | |
[:_, 9, 8, :_, :_, :_, :_, 6, :_], | |
[8, :_, :_, :_, 6, :_, :_, :_, 3], | |
[4, :_, :_, 8, :_, 3, :_, :_, 1], | |
[7, :_, :_, :_, 2, :_, :_, :_, 6], | |
[:_, 6, :_, :_, :_, :_, 2, 8, :_], |
$:.unshift("/Library/RubyMotion/lib") | |
require File.join(File.dirname(__FILE__), 'version') | |
require 'motion/project' | |
require 'bundler' | |
Bundler.require |
class FizzBuzz { | |
String isPrintable ( divisor1=3, divisor2=5, number ) { | |
(number % (divisor1 * divisor2) == 0) ? "FIZZBUZZ" : | |
(number % divisor2 == 0) ? "BUZZ": | |
(number % divisor1 == 0) ? "FIZZ": "$number" | |
} | |
Map calcula(List lista){ | |
if(lista.size()==1) |