Skip to content

Instantly share code, notes, and snippets.

View vincentpaca's full-sized avatar

Vincent Paca vincentpaca

View GitHub Profile
vincentpaca /
Last active August 29, 2015 14:05
Deis and Google Cloud Compute Engine integration

fleetctl v0.7.1 fleet v0.7.1 deis v0.11.0

Setting Up Google Cloud utilities

  1. Install the gcloud utility by running curl | bash
  2. Follow the steps.
    • If using zsh, edit your .zshrc file near the bottom and find the lines that were added by the] gcloud util install. Replace with, do the same with completion.
vincentpaca / deis_errors1
Last active August 29, 2015 14:06
Deis wrong ruby versions
> cat Gemfile
ruby '2.1.2'
> deis run 'ruby -v'
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
> deis run 'rake'
/bin/bash: rake: command not found
vincentpaca / mime_types.rb
Created November 9, 2011 18:40
Mime Types
Mime::Type.register_alias "text/html", :mobile
vincentpaca / application_controller.rb
Created November 10, 2011 10:03
Application Controller
before_filter :prepare_for_mobile
def mobile_device?
if session[:mobile_param]
session[:mobile_param] == "1"
request.user_agent =~ /Mobile|webOS/
vincentpaca / mime_types.rb
Created November 10, 2011 10:04
Mime Types w/ Multiple aliases
Mime::Type.register_alias "text/html", :mobile
Mime::Type.register_alias "text/html", :iPad
<!DOCTYPE html>
<%= stylesheet_link_tag "/jqtouch/jqtouch.css", "/jqtouch/themes/jqt/theme.css" %>
<%= javascript_include_tag "/jqtouch/jquery-1.4.2.min.js", "/jqtouch/jqtouch.js", "mobile" %>
<%= csrf_meta_tag %>
<div class="home">
vincentpaca / mobile.js
Created November 12, 2011 10:25
vincentpaca / log
Created January 2, 2012 07:58
Ruby 1.9.3p0 Rails 3.1.3 Rake breaks on rake db:migrate
pax@ubuntu:~/projects/missionhub$ ruby -v
ruby 1.9.3p0 (2011-10-30 revision 33570) [i686-linux]
pax@ubuntu:~/projects/missionhub$ rails -v
Rails 3.1.3
pax@ubuntu:~/projects/missionhub$ rake -V
rake, version
pax@ubuntu:~/projects/missionhub$ bundle exec rake db:migrate --trace
DEPRECATION WARNING: Yajl's JSON gem compatibility API is going to be removed in 2.0
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
vincentpaca / config.yml
Created January 28, 2012 22:21
Bitly config
bitly_username: yourusername
bitly_key: yourkey
vincentpaca / bitly.rb
Created January 28, 2012 22:23
Bitly initializer
require Rails.root.join('config','initializers','load_config')
BITLY_CLIENT =['bitly_username'], APP_CONFIG['bitly_key'])