Skip to content

Instantly share code, notes, and snippets.

View mborromeo's full-sized avatar

Marco Borromeo mborromeo

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mborromeo on github.
  • I am mborromeo (https://keybase.io/mborromeo) on keybase.
  • I have a public key whose fingerprint is 7289 768D 4D0C 982F 6D51 1693 56A7 C705 0EE0 C11C

To claim this, I am signing this object:

RollingSpider = require("rolling-spider")
Keyboard = require('keypress');
Keyboard(process.stdin);
drone = new RollingSpider
uuid: 'dde3787fc4804b8a895efa2757771448'
logger: console.log
forceConnect: false
lussuria:api marborromeo$ bundle exec rspec spec/api/admin/users/create_spec.rb
WARNING: could not load hiredis extension, using (slower) pure Ruby implementation.
Exception in thread "JRubyWorker-1" java.lang.NullPointerException
at com.rubyeventmachine.EmReactor.setCommInactivityTimeout(EmReactor.java:442)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:470)
at org.jruby.javasupport.JavaMethod.tryProxyInvocation(JavaMethod.java:641)
#
# s3_store.rb
#
require "em-synchrony"
require "em-synchrony/em-http"
class S3Store
def initialize(uri)
@uri = uri
end
@mborromeo
mborromeo / ssh-copy-id
Created February 24, 2012 14:38
ssh-copy-id
#!/bin/sh
ID_FILE="${HOME}/.ssh/id_rsa.pub"
if [ "-i" = "$1" ]; then
shift
# check if we have 2 parameters left, if so the first is the new ID file
if [ -n "$2" ]; then
if expr "$1" : ".*\.pub" > /dev/null ; then
ID_FILE="$1"
@mborromeo
mborromeo / gist:715220
Created November 25, 2010 11:11
[iPhone / iPad] Check if device is an iPad with 3.x devices
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200
#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#else
#define IS_IPAD false
#endif
#! /bin/sh
# put this file into /etc/init.d/nginx (make it executable +x)
# then launch it as "/usr/sbin/update-rc.d -f nginx defaults" to execute it at startup
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
@mborromeo
mborromeo / iphone-view-custom-background-image.c
Created May 27, 2010 10:00
[iPhone] Set a custom image as view background
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"image.png"]];
@mborromeo
mborromeo / rails-3-mongo-devise.rb
Created May 20, 2010 23:19
Rails 3 Master + MongoDB + Devise template
# This Rails template will generate a Rails 3 (MASTER) application, with MongoDB as ORM and Devise for authentication.
# You will require ruby 1.9.2-HEAD to run generated app.
file 'Gemfile', <<-GEMS
source 'http://gemcutter.org'
gem "rails", :git => "git://github.com/rails/rails.git"
gem "mongoid", "2.0.0.beta4"
gem "bson_ext", "0.20.1"
gem "inherited_resources"
gem "devise", :git => "git://github.com/plataformatec/devise.git"
@mborromeo
mborromeo / env.rb
Created May 14, 2010 23:03
My (working) mongoid + cucumber env.rb
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
# It is recommended to regenerate this file in the future when you upgrade to a
# newer version of cucumber-rails. Consider adding your own code to a new file
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files.
ENV["RAILS_ENV"] ||= "test"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support