Skip to content

Instantly share code, notes, and snippets.

View sapient's full-sized avatar

Mark Howell sapient

View GitHub Profile
class ResumesController < ApplicationController
before_filter :authenticate_user!
respond_to :pdf
def index
end
def preview
# Error Correction Capacity (ECC) level
# L - 7% of codewords can be recovered
@sapient
sapient / code.rb
Created September 17, 2011 18:43 — forked from caius/code.rb
require "uri"
(URI::REGEXP.constants - ["PATTERN"]).each do |rc|
puts "#{rc}: #{URI::REGEXP.const_get(rc)}"
end
URI::REGEXP::PATTERN.constants.each do |pc|
puts "#{pc}: #{URI::REGEXP::PATTERN.const_get(pc)}"
end
@sapient
sapient / bookmarklet.js
Created September 13, 2011 10:42 — forked from FlatEarthTruther/bookmarklet.js
advanced bookmarklet template
javascript:(function() {
if(!window.your_bookmarklet) {
var doc = document,
js = doc.createElement('script');
js.type = 'text/javascript';
js.src = 'loader.js';
js.async = true;
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
# The form which submits to profile#index
<div id="member_search">
<%= form_tag profile_path, :method => :get do %>
<table style="width:100%">
<tbody>
<tr>
<td style="text-align:right;padding-right:5px;">Name: </td>
<td><%= text_field_tag :s_name, params[:s_name] %></td>
</tr>
<tr>
<%= @user.work_country_id.nil? ? "No Country" : @user.work_country.name %>