Skip to content

Instantly share code, notes, and snippets.

View MikeRuby's full-sized avatar

Michael Vallen MikeRuby

  • Acceleration Ventures
  • San Diego, CA
View GitHub Profile
http://www.bungie.net/platform/JSONP/GetBungieNetUser/
http://www.bungie.net/platform/User/CreateUser/
http://www.bungie.net/platform/User/UpdateUser/
http://www.bungie.net/platform/User/UpdateUserAdmin/[d]/
http://www.bungie.net/platform/User/Notification/Update/
http://www.bungie.net/platform/User/MessageFlags/Success/Update/[f]/
http://www.bungie.net/platform/User/GetBungieNetUser/
http://www.bungie.net/platform/User/GetCounts/
http://www.bungie.net/platform/User/GetBungieNetUserById/[userId]/
http://www.bungie.net/platform/User/GetUserAliases/[userId]/

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@MikeRuby
MikeRuby / Gemfile
Last active August 29, 2015 14:16 — forked from pcreux/Gemfile
group :production do
gem 'unicorn'
# Enable gzip compression on heroku, but don't compress images.
gem 'heroku-deflater'
# Heroku injects it if it's not in there already
gem 'rails_12factor'
end
# Ways to execute a shell script in Ruby
# Example Script - Joseph Pecoraro
cmd = "echo 'hi'" # Sample string that can be used
# 1. Kernel#` - commonly called backticks - `cmd`
# This is like many other languages, including bash, PHP, and Perl
# Returns the result of the shell command
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111

Ubuntu 12.04, Ruby, Rails, Nginx, Unicorn and git-deploy

In the seemlingly endless search for the actual correct and easy way to deploy a Rails app, we have tried several ways. We tried out using Apache2 and running a cluster of Thin servers. With the built in threading of Puma we decided to use it with Nginx.

Server Setup

  • Create new server
  • Login to new server
    • ssh root@IPaddress (you can also use the domain name if you have the DNS setup already)
    • accept the RSA key
@MikeRuby
MikeRuby / gist:8808873
Created February 4, 2014 17:56
Jcrop + Carrierwave
# https://github.com/gzigzigzeo/carrierwave-meta
# The uploader:
class CropUploader < SobakaUploader
include CarrierWave::Meta
# Crop source is a source image converted from original which could be bigger than source area (left image in the example).
version :crop_source do
process :resize_to_fit => [300, 300]
class MyUploader < CarrierWave::Uploader::Base
include Thumbkit::Adapters::CarrierWave
# Watermark should always be processed after thumbkit, ensuring that we always
# have a valid image and we don't need to change the extension
def watermark(watermark_image, options = {})
cache_stored_file! if !cached?
Watermarker.new(current_path, watermark_image).watermark!(options)
end
/*
* Normalized hide address bar for iOS & Android
* (c) Scott Jehl, scottjehl.com
* MIT License
*/
(function( win ){
var doc = win.document;
// If there's a hash, or addEventListener is undefined, stop here
if( !location.hash && win.addEventListener ){
#ruby-enterprise-1.8.6-20090610
cd ruby-enterprise-1.8.6-20090610/source/ext/iconv
/opt/ruby-enterprise-1.8.6-20090610/bin/ruby extconf.rb --prefix=/opt/ruby-enterprise-1.8.6-20090610 --with-iconv-dir=/usr/local/
make
cp iconv.so /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/1.8/x86_64-freebsd7.2/
/*
Jquery and Rails powered default application.js
Easy Ajax replacement for remote_functions and ajax_form based on class name
All actions will reply to the .js format
Unostrusive, will only works if Javascript enabled, if not, respond to an HTML as a normal link
respond_to do |format|
format.html
format.js {render :layout => false}
end
*/