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
# Example how to use HTTParty | |
# see http://railstips.org/2008/7/29/it-s-an-httparty-and-everyone-is-invited | |
require 'rubygems' | |
require 'httparty' | |
require 'pp' | |
config = YAML::load(File.read(File.join(ENV['HOME'], '.delicious'))) | |
class Delicious | |
include HTTParty |
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
curl -k --user username:password -o backup.xml -O 'https://api.del.icio.us/v1/posts/all' | |
# or with wget | |
# wget --no-check-certificate --user=username --password=password -Obackup.xml https://api.del.icio.us/v1/posts/all | |
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 'sinatra' | |
set :views, File.dirname(__FILE__) + '/' | |
get '/formgen.js' do | |
# form kann z.B. aus Datei gelesen werden | |
content = '<form id="form">'; | |
content += 'E-Mail: <input type="text" name="email" id="email"><br>'; | |
content += 'Text: <input type="text" name="message" id="message"><br>'; | |
content += '<input type="submit" value="send" id="send"></form>'; |
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
# =================== | |
# = Global Settings = | |
# =================== | |
set :application, "myapp" | |
set :domain, "family.bridge-mx11.de" | |
set :user, "deploy-familygame" | |
set :use_sudo, false | |
set :rails_env, "production" | |
# ======= |
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
mysql> select * from sites; | |
+----+-----------------------+-------------+--------------+----------+-------------+ | |
| id | host | layout | cetrel_appid | show_all | redirect_to | | |
+----+-----------------------+-------------+--------------+----------+-------------+ | |
| 3 | reisen.sales-lentz.lu | application | VSL | 1 | travels_url | | |
| 4 | reisen.travel.lu | travel_lu | TRR | 1 | travels_url | | |
| 5 | xmas.sales-lentz.lu | xmas | VSL | 1 | | | |
+----+-----------------------+-------------+--------------+----------+-------------+ | |
3 rows in set (0.01 sec) |
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
module ActionController | |
class Base < Metal | |
abstract! | |
include AbstractController::Callbacks | |
include AbstractController::Logger | |
include ActionController::Helpers | |
include ActionController::HideActions | |
include ActionController::UrlFor |
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
module ActionController | |
# Layouts reverse the common pattern of including shared headers and footers in many templates to isolate changes in | |
# repeated setups. The inclusion pattern has pages that look like this: | |
# | |
# <%= render "shared/header" %> | |
# Hello World | |
# <%= render "shared/footer" %> | |
# | |
# This approach is a decent way of keeping common structures isolated from the changing content, but it's verbose | |
# and if you ever want to change the structure of these two includes, you'll have to change all the templates. |
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
migration 1, :shoe do | |
up do | |
create_table :shoes do | |
column :id, Serial, :nullable? => false | |
column :brand, String,, :nullable? => false | |
column :price, Float,, :nullable? => false | |
column :available, Boolean, :nullable? => false | |
column :created_at, DateTime, :nullable? => false | |
column :updated_at, DateTime, :nullable? => false | |
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
def initialize(params={}) | |
@from_date=params["from_date"].to_date if params["from_date"] | |
@to_date=params["to_date"].to_date if params["to_date"] | |
@from_time=params["from_time"] if params["from_time"] | |
@to_time=params["to_time"] if params["to_time"] | |
@busroute_ids=params["busroute_ids"] if params | |
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
def initialize(params={}) | |
if params.kind_of? Hash | |
@from_date=params["from_date"].to_date | |
@to_date=params["to_date"].to_date | |
@from_time=params["from_time"] | |
@to_time=params["to_time"] | |
@busroute_ids=params["busroute_ids"] | |
end | |
end |