Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
Working hard for the money

rob phillips iwasrobbed

:shipit:
Working hard for the money
View GitHub Profile
View gist:995348
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="SOAPAction">
<domain uri="*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
View gist:995182
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" secure="false" />
</cross-domain-policy>
View gist:977315
class ImportController << ApplicationController
require 'net/http'
require 'net/https'
require 'uri'
#THIS METHOD TO SEND USER TO THE GOOGLE AUTHENTICATION PAGE.
def authenticate
# initiate authentication w/ gmail
# create url with url-encoded params to initiate connection with contacts api
@iwasrobbed
iwasrobbed / gist:906235
Created Apr 6, 2011
Infinite scrolling modified for ajax
View gist:906235
function kickOffAjax(){
// we dont want to fire the ajax multiple times
opts.isDuringAjax = true;
// show the loading message quickly
// then hide the previous/next links after we're
// sure the loading message was visible
props.loadingMsg.appendTo( opts.loadMsgSelector ).show(opts.loadingMsgRevealSpeed, function(){
$( opts.navSelector ).hide();
View gist:864769
root /(.:format) {:controller=>"users", :action=>"new"}
sessions POST /sessions(.:format) {:action=>"create", :controller=>"sessions"}
new_session GET /sessions/new(.:format) {:action=>"new", :controller=>"sessions"}
session DELETE /sessions/:id(.:format) {:action=>"destroy", :controller=>"sessions"}
user_favorite GET /users/:user_id/favorites/:id(.:format) {:action=>"show", :controller=>"favorites"}
PUT /users/:user_id/favorites/:id(.:format) {:action=>"update", :controller=>"favorites"}
user_profile GET /users/:user_id/profile/:id(.:format) {:action=>"show", :controller=>"profile"}
PUT /users/:user_id/profile/:id(.:format) {:action=>"update", :controller=>"profile"}
View gist:859792
= link_to "Link name",
{ :controller => 'controller_name', :action => 'action_name' },
:class => 'someclass'
View gist:859791
= link_to "Sign out", signout_path,
:method => :delete,
:class => "nohover tl light"
View gist:858637
#config/initializers/requires.rb
Dir[File.join(Rails.root, 'lib', '*.rb')].each do |f|
require f
end
View gist:858636
<table>
<%= render :partial => 'foo_row', :collection => @foobars %>
</table>
# _foo_row.html.erb
<tr>
<td>
<%= foobar.name %>
</td>
View gist:858633
# app/views/layout/application.rb
<html>
<head>
<%= yield :head %>
...
# app/views/foobars/index.html.erb
<% content_for :head do %>
<script type='text/javascript'>