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
def index | |
@${1:things} = ${2:Thing}.find :all | |
respond_to do |format| | |
format.html # index.html.erb | |
format.xml { render :xml => @$1 } | |
end | |
end | |
def show |
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
# Stupid polling of TVI.pt latest videos | |
# Also tries to match a string to test for specific videos | |
# If true, it sends a Growl notification and outputs the video title to STDOUT | |
require 'rubygems' | |
require 'open-uri' | |
require 'cgi' | |
require 'hpricot' | |
require 'ruby-growl' |
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
# Export your Wordpress posts to Tumblr (also allows to delete some.) | |
# Author: Alexandre Solleiro <[email protected]> | |
# How-to: | |
# 1. Export your Wordpress posts (http://en.blog.wordpress.com/2006/06/12/xml-import-export/) | |
# 2. Edit the information below to match your settings | |
# 3. To import, type "ruby wordpress2tumblr.rb --run" in the command line | |
# 4. To delete some posts, type "ruby wordpress2tumblr.rb --delete 1,2,3,4" where 1,2,3,4 are post numbers. (Be careful not to use spaces between IDs) | |
# Edit these | |
WP_EXPORT_PATH = "./wordpress.2009-09-14.xml" # path to the Wordpress Export file |
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
#!/usr/local/bin/ruby | |
# | |
# Name: ss | |
# Description: ss is a ./script/server shortcut | |
# Author: Alex Solleiro <[email protected]> | |
# Instructions: | |
# Save this file as 'ss' within a directory in your $PATH | |
# Make it executable, ex: 'chmod +x ss' | |
# Type 'ss' at the root of a Rails app to run './script/server' | |
# You can pass arguments in the usual way |
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
/* Styles for p, div or span with nice FamFamFam icons, to use around a link*/ | |
.add {font-size: 12px; background: url('/images/icons/add.png') 0 0 no-repeat; padding-left: 18px; line-height: 16px; font-weight: normal;} | |
.new_password {font-size: 12px; background: url('/images/icons/lock_go.png') 0 0 no-repeat; padding-left: 18px; line-height: 16px; font-weight: normal;} | |
.ok {font-size: 12px; background: url('/images/icons/accept.png') 0 0 no-repeat; padding-left: 18px; line-height: 16px; font-weight: normal;} | |
.edit {font-size: 12px; background: url('/images/icons/pencil.png') 0 0 no-repeat; padding-left: 18px; line-height: 16px; font-weight: normal;} | |
.delete {font-size: 12px; background: url('/images/icons/delete.png') 0 0 no-repeat; padding-left: 18px; line-height: 16px; font-weight: normal;} | |
.show {font-size: 12px; background: url('/images/icons/magnifier.png') 0 0 no-repeat; padding-left: 18px; line-height: 16px; font-weight: normal;} |
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
require 'rubygems' | |
require 'open-uri' | |
require 'cgi' | |
require 'hpricot' | |
require 'ruby-growl' | |
url = "http://www.tvi.iol.pt/frame_videos_tvi.html" | |
growl = Growl.new 'localhost', 'ruby-growl', ["ruby-growl Notification"] | |
loop do |
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
$('.slide').each(function() { | |
$(this).hide(); | |
}); | |
(function shownext(jq){ | |
jq.eq(0).fadeIn(500, function(){ | |
$(this).delay(5500).fadeOut(250, function() { | |
if ((jq=jq.slice(1)).length == 0) | |
(jq=$('.slide')).length && shownext(jq); | |
else |
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 DashboardController < ApplicationController | |
before_filter :authenticate_user! | |
def index | |
end | |
def post_activity | |
test_activity = Manybots::Feed::Item.new_test_activity(current_user) | |
activity_from_manybots = current_user.post_to_manybots!(test_activity) |
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
{ | |
"data": { | |
"items": [ | |
{ | |
"id": "http://examplemanybotsserver.com/activities/170", | |
url: "http://examplemanybotsserver.com/activities/170", | |
"title": "<%= "<a href='http://examplemanybotsserver.com/users/1'>Alex Solleiro</a> joined <a href='http://examplemanybotsserver.com'>Manybots Server</a>."%>", | |
"summary": "Welcome to Manybots Server", | |
"published": "2010-11-09 17:22:41 UTC", | |
"tags": [ "manybots", "account"], |
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
# encoding: UTF-8 | |
require 'rubygems' | |
require 'json/add/core' | |
require 'httparty' | |
TOKEN = 'YOUR API TOKEN' #find it in your /account page | |
module Manybots | |
OlderNewer