Skip to content

Instantly share code, notes, and snippets.

@weppos
weppos / capistrano_database_yml.rb
Created July 27, 2008 10:04
Provides a couple of tasks for creating the database.yml configuration file dynamically when deploy:setup is run.
#
# = Capistrano database.yml task
#
# Provides a couple of tasks for creating the database.yml
# configuration file dynamically when deploy:setup is run.
#
# Category:: Capistrano
# Package:: Database
# Author:: Simone Carletti <[email protected]>
# Copyright:: 2007-2010 The Authors
@rtomayko
rtomayko / Tests Is Wrong
Created January 28, 2009 20:50
Why "require 'rubygems'" In Your Library/App/Tests Is Wrong
In response to all the responses to:
http://twitter.com/rtomayko/status/1155906157
You should never do this in a source file included with your library,
app, or tests:
require 'rubygems'
The system I use to manage my $LOAD_PATH is not your library/app/tests
@thata
thata / grep-gems
Created February 18, 2009 02:24
grep-gems
#! /bin/sh
# grep-gems
#
# (1) grep rubygems sources.
# > grep-gems "def select_tag"
#
# (2) open source.
# > grep-gems "def select_tag"
# 1 /usr/lib/ruby/gems/1.8/gems/foo/a.rb
namespace :deploy do
namespace :notify do
desc 'Send release message to skype chat'
task :skype do
begin
require 'rb-skypemac'
rescue LoadError
puts 'rb-skypemac is required.'
end
chat_id = '#komagata1111/$xxxxxxxxxxxxx'
attachments: parent_id, asset_id
domain_names: organisation_id
event_memberships: user_id, event_id
events: editor_id
group_actions: user_id, group_id
groups: user_id
icons: parent_id
invitations: sender_id
legacy_actions: item_upon_id
news_items: author_id
@joho
joho / envato-senior-dev.markdown
Created November 16, 2009 05:08
Senior Ruby on Rails Developer @ Envato

Senior Ruby on Rails Developer @ Envato

Hi, we're Envato and we're looking for a "senior" Ruby on Rails developer.

We know it's a bit absurd to ask for seniors for a new-ish technology, but we're more looking for the senior mindset, for depth and breadth of experience in delivering good quality code, and helping your teammates achieve the same. We need the kind of people we can point at a big problem with maybe another dev or two by their side and come out with a neat solution on the other side. We'd prefer to hire someone with practical, commercial Ruby on Rails experience, but if you're a Python, Java, .NET, Haskell, LISP, or whatever else developer who picks up new things quickly and can get things DONE we want to speak with you.

First though: a bit about us. We're a youngish company, transitioning out of the hectic startup days and into something a bit bigger and more settled. We operate a series of online stock digital media marketplaces such as Activeden (formerly FlashDen), GraphicRiver, ThemeF

@nojimage
nojimage / index.html
Created December 4, 2009 17:07
jquery.justify.js
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>jQuery Justify</title>
<script type="text/javascript" src="js/jquery.1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery.justify.js"></script>
<script type="text/javascript">
$(document).ready(function(){
@josegonzalez
josegonzalez / category.rb
Created August 14, 2010 21:41
Category plugin for Jekyll
module Jekyll
class CategoryIndex < Page
def initialize(site, base, dir, category)
@site = site
@base = base
@dir = dir
@name = 'index.html'
self.process(@name)
self.read_yaml(File.join(base, '_layouts'), 'category_index.html')
@remvee
remvee / ignore_unknown_http_method.rb
Created September 28, 2010 07:39
silence ActionController::UnknownHttpMethod exceptions
# Avoid annoying ActionController::UnknownHttpMethod exceptions like:
#
# ActionController::UnknownHttpMethod) "CONNECT, accepted HTTP methods are get, head, put, post, delete, and options"
#
# Install this file in app/metal and these requests will receive a 405
# "Method Not Allowed" status and will be logged under `info'.
class IgnoreUnknownHttpMethod
def self.call(env)
[
if ActionController::Request::HTTP_METHODS.include?(env["REQUEST_METHOD"].downcase)
@tdtds
tdtds / maouyusya2aozora.rb
Created December 21, 2010 09:29
まとめサイト上の「まおゆう」を青空文庫形式のテキストファイルに変換する
#!/usr/bin/ruby
# -*- coding: utf-8; -*-
#
require 'open-uri'
require 'nokogiri'
puts "魔王「この我のものとなれ、勇者よ」勇者「断る!」"
puts "橙乃ままれ"
puts "\n\n"