Skip to content

Instantly share code, notes, and snippets.

View joselo's full-sized avatar

Jose Carrion joselo

View GitHub Profile
@joselo
joselo / spacemacs-cheatsheet.txt
Created February 24, 2017 04:27 — forked from 526avijitgupta/spacemacs-cheatsheet.md
Spacemacs cheatsheet
`emacs --daemon` to run in the background.
`emacsclient.emacs24 <filename/dirname>` to open in terminal
NOTE: "M-m and SPC can be used interchangeably".
* Undo - `C-/`
* Redo - `C-?`
* Change case: 1. Camel Case : `M-c`
2. Upper Case : `M-u`
3. Lower Case : `M-l`
FROM ruby:2.2.3
RUN apt-get update -qq
RUN apt-get install -y -qq build-essential
RUN apt-get install -y -qq nodejs
RUN apt-get install -y -qq libpq-dev
ENV APP_HOME /app
ENV BUNDLE_PATH /bundle
ENV BUNDLE_JOBS 5
@joselo
joselo / deploy.rb
Last active August 29, 2015 14:15 — forked from jbonney/deploy.rb
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rvm'
# Usually mina focuses on deploying to one host and the deploy options are therefore simple.
# In our case, there is a number of possible servers to deploy to, it is therefore necessary to
# specify the host that we are targeting.
server = ENV['server']
# Since the same host can have multiple applications running in parallel, it is necessary to
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
# Add rbenv to the path:
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
# require 'mina/rbenv' # for rbenv support. (http://rbenv.org)
require 'mina/rvm' # for rvm support. (http://rvm.io)
require 'mina/unicorn'
require 'mina/whenever'
# Basic settings:
# domain - The hostname to SSH to.
Capybara.add_selector :record do
xpath { |record| XPath.css("#" + ActionController::RecordIdentifier.dom_id(record)) }
match { |record| record.is_a?(ActiveRecord::Base) }
end
@joselo
joselo / static_map_helper.rb
Created July 16, 2012 02:41 — forked from mcasimir/static_map_helper.rb
Google Maps Static map helper for Ruby on Rails
module StaticMapHelper
def static_map_for(location, options = {})
params = {
:center => [location.lat, location.lng].join(","),
:zoom => 15,
:size => "300x300",
:markers => [location.lat, location.lng].join(","),
:sensor => true
}.merge(options)
@joselo
joselo / es.sh
Created June 29, 2012 17:30 — forked from kajic/es.sh
Install ElasticSearch on Ubuntu 10.04/11.04
cd ~
sudo apt-get update
sudo apt-get install curl python-software-properties -y
sudo apt-get install openjdk-6-jre-headless
curl -L https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.18.7.tar.gz | tar -xz
sudo mv elasticsearch-* /usr/local/share/elasticsearch
curl -L http://github.com/elasticsearch/elasticsearch-servicewrapper/tarball/master | tar -xz
sudo mv *servicewrapper*/service /usr/local/share/elasticsearch/bin/
rm -Rf *servicewrapper*
@joselo
joselo / application.rb
Created April 13, 2012 17:53 — forked from baphled/application.rb
Jasmine config to compile coffeescript and copy assets files for testing
# Needed if you are not requiring rails/all
require 'sprockets/railtie'
@joselo
joselo / Running watchr.sh
Created April 13, 2012 17:37 — forked from johnbintz/Running watchr.sh
Running RSpec and jasmine-headless-webkit using watchr
# all tests, run all at start
ACCEPTANCE=true watchr test.watchr
# all tests, don't run at start
ACCEPTANCE=true watchr test.watchr -- -f
# skip acceptance (the slow ones)
watchr test.watchr