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
// Based on apidock.org Ubiquity Search: http://gist.github.com/8132 | |
// Edited to use favicon.ico | |
CmdUtils.CreateCommand( | |
{ | |
name: "code", | |
takes: {"function": noun_arb_text}, | |
icon: "http://github.com/favicon.ico", | |
homepage: "http://tiago.zusee.com", | |
author: {name: "Tiago Bastos", email: "comechao@gmail.com"}, | |
license: "MPL,GPL", |
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
// Insert a map, based on IP GeoLocation. | |
CmdUtils.CreateCommand({ | |
name: "map-me", | |
description: "Dynamically insert a map, based on IP GeoLocation.", | |
_getMapUrl: function() { | |
var loc = CmdUtils.getGeoLocation(); | |
var mapUrl = "http://maps.google.com/staticmap?"; | |
var params = { |
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
Oshuma = { | |
homepage: "http://corrupt.save-state.net", | |
author: { name: "Dale Campbell", email: "dale@save-state.net"}, | |
license: "WTFPL" | |
}; | |
WeeWar = { | |
_baseUrl: "http://weewar.com/api1", | |
_siteIcon: "http://weewar.com/favicon.ico", |
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 LookAt | |
DEFAULTS = {:output => true} | |
def initialize(thing, options = {}) | |
@thing = thing | |
@options = DEFAULTS.merge(options) | |
meths = case @thing.class | |
when Class, Module | |
(@thing.methods.sort - Class.methods) | |
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
This is ApacheBench, Version 2.3 <$Revision: 655654 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking 127.0.0.1 (be patient) | |
Server Software: | |
Server Hostname: 127.0.0.1 | |
Server Port: 4000 |
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
Merb::BootLoader.before_app_loads do | |
# This will get executed after dependencies have been loaded but before your app's classes have loaded. | |
require 'config/settings' | |
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
# config/app_config.yml | |
# Keep this out of version control if you have sensitive information!! | |
defaults: &defaults | |
name: Super Awesome Blog | |
tagline: My super awesome blog and stuff. | |
email: you@example.org | |
development: | |
<<: *defaults | |
# Override the defaults. |
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 create(comment) | |
@article = Article.get(params[:article_id]) | |
@comment = Comment.new(comment.merge(:article => @article)) | |
if @comment.save | |
redirect resource(@article), :message => {:notice => 'Your comment was saved.'} | |
else | |
redirect resource(@article), :message => {:error => 'Must fill in all fields.'} | |
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
def create_article(options = {}) | |
create_and_authenticate_user | |
Article.all.destroy! | |
request(resource(:articles), :method => "POST", | |
:params => { :article => { :id => nil, :title => 'Title', | |
:content => 'Blog post.' }}) | |
end | |
def create_and_authenticate_user | |
User.all.destroy! |
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/bin/env ruby | |
# Small app to control your Itunes via HTTP. | |
# | |
# Usage: `$ ruby itunes.rb`, then visit `http://localhost:4567` | |
# Requires sinatra: `$ sudo gem install sinatra` | |
require 'rubygems' | |
require 'sinatra' | |
get '/do' do |