Skip to content

Instantly share code, notes, and snippets.

View nandosola's full-sized avatar

Nando Sola nandosola

View GitHub Profile
@nandosola
nandosola / settings.xml
Created August 9, 2012 11:15
Generic ~/.m2/settings.xml to use with Torquebox Rubygems Maven Proxy
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<profiles>
<profile>
<id>jruby</id>
<repositories>
<repository>
<id>rubygems-proxy</id>
<name>Rubygems Proxy</name>
@nandosola
nandosola / CreateAndShowGUI.java
Created August 22, 2012 11:00
Call Java/Swing from C++/Qt with JNI - requires Oracle Java 7u4 or OpenJDK 7u3 (or higher)
import java.lang.reflect.InvocationTargetException;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
public class CreateAndShowGUI extends Thread{
Runnable HelloWorldFrame = new Runnable() {
public void run() {
@nandosola
nandosola / sl2ml.txt
Created October 30, 2012 20:17
Snow Leopard to Mountain Lion notes
https://gist.github.com/1860902
https://gist.github.com/3210129
https://github.com/sstephenson/ruby-build/issues/193
http://coderwall.com/p/pagj2w
http://apple.stackexchange.com/questions/58116/enabling-java-7-on-mountain-lion
http://www.graphviz.org/Download_macos.php
https://trac.macports.org/ticket/32575
http://stackoverflow.com/questions/6116697/macports-python-select-command-not-found
@nandosola
nandosola / macvim.txt
Created October 30, 2012 20:19
MacVim notes
http://wiredupandfiredup.blogspot.com.es/2008/09/pimp-your-macvim.html
http://spf13.com/post/perfect-vimrc-vim-config-file/
https://github.com/altercation/vim-colors-solarized
https://wincent.com/products/command-t
http://superuser.com/questions/247678/installing-command-t-breaks-macvim
@nandosola
nandosola / tmux_osx.txt
Created October 30, 2012 22:12
tmux + OS X notes
http://cheat.errtheblog.com/s/tmux/
http://blog.sanctum.geek.nz/vi-mode-in-tmux/
https://gist.github.com/1769870
http://unix.stackexchange.com/questions/15715/getting-tmux-to-copy-a-buffer-to-the-clipboard
http://www.drbunsen.org/text-triumvirate.html#tmux
@nandosola
nandosola / Gemspec
Created March 26, 2013 16:12
Ejemplo para RSpec
source 'http://rubygems.org'
gem 'sinatra', '1.3.6'
gem 'json', '1.7.7'
gem 'haml', '3.1.7'
gem 'mongoid', '3.1.2'
gem 'bcrypt-ruby', '3.0.1'
gem 'rest-client', '1.6.7'
gem 'stringex', '1.5.1'
gem 'vlad', :require => false
@nandosola
nandosola / config.ru
Created April 3, 2013 08:55
Torquebox needs its tmpdirs to be set by applications
#... requires
ENV['RACK_ENV'] ||= 'development'
# This tempdir stuff is important for Torquebox deployments
(tmp = '.'
dirs = [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], '/tmp', tmp]
for dir in dirs
unless dir.nil?
stat = File.stat(dir)
@nandosola
nandosola / Rakefile
Last active December 16, 2015 07:08 — forked from frobs/Rakefile
# encoding: utf-8
require 'rubygems'
require 'bundler'
Bundler.setup(:default)
APP_ROOT = File.join(File.dirname(__FILE__))
SUPPORTED_BROWSERS=%w(firefox chrome safari ie9 ie8 ie7)
TEST_BROWSER='poltergeist'
# See: http://www.ruby-forum.com/topic/207203
@nandosola
nandosola / torquebox.rb
Last active December 16, 2015 20:49
http://localhost:8080/fileservice seems to be routed to "torquebox.rack" no matter what. Below are my app/WEB-INF/web.xml and app/config/torquebox.rb The java JARs are loaded from app/vendor/jars
TorqueBox.configure do
web do |web|
web.context '/'
end
ruby do
version '1.9'
end
environment do
TMPDIR '/tmp/torquebox'
end
@nandosola
nandosola / daemon.rb
Last active December 17, 2015 04:59 — forked from ik5/daemon.rb
Daemonizing Puma in JRuby using the 'spoon' gem
#!/usr/bin/env jruby
require 'rubygems'
require 'spoon'
APPNAME = 'fileserver'
WORK_PATH = Dir.pwd
EXEC = "#{ENV['HOME']}/.rbenv/shims/puma"
PID_PATH = "#{WORK_PATH}/log/#{APPNAME}.pid"
OUT_PATH = "#{WORK_PATH}/log/#{APPNAME}.out.log"