Skip to content

Instantly share code, notes, and snippets.

View vincentpaca's full-sized avatar

Vincent Paca vincentpaca

View GitHub Profile
@vincentpaca
vincentpaca / deis_gce.md
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 https://sdk.cloud.google.com | 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 path.bash.inc with path.zsh.inc, do the same with completion.
@vincentpaca
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
vincentpaca / mime_types.rb
Created November 9, 2011 18:40
Mime Types
Mime::Type.register_alias "text/html", :mobile
@vincentpaca
vincentpaca / application_controller.rb
Created November 10, 2011 10:03
Application Controller
before_filter :prepare_for_mobile
private
def mobile_device?
if session[:mobile_param]
session[:mobile_param] == "1"
else
request.user_agent =~ /Mobile|webOS/
end
@vincentpaca
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>
<html>
<head>
<title>Mobile</title>
<%= 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 %>
</head>
<body>
<div class="home">
@vincentpaca
vincentpaca / mobile.js
Created November 12, 2011 10:25
Mobile
$.jQTouch({});
@vincentpaca
vincentpaca / log
Created January 2, 2012 07:58
Ruby 1.9.3p0 Rails 3.1.3 Rake 0.9.2.2 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 0.9.2.2
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
vincentpaca / config.yml
Created January 28, 2012 22:21
Bitly config
development:
bitly_username: yourusername
bitly_key: yourkey
@vincentpaca
vincentpaca / bitly.rb
Created January 28, 2012 22:23
Bitly initializer
require Rails.root.join('config','initializers','load_config')
Bitly.use_api_version_3
BITLY_CLIENT = Bitly.new(APP_CONFIG['bitly_username'], APP_CONFIG['bitly_key'])