gem 'remote_syslog_logger'
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 | |
require 'rubygems' | |
require 'jabber/bot' | |
# Create a new bot | |
bot = Jabber::Bot.new({ | |
:name => 'Git Rails Bot', | |
:jabber_id => '[email protected]', | |
:password => 'same-password-everywhere', | |
:master => ["[email protected]"], |
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
package main | |
import ( | |
"fmt" | |
"io" | |
"log" | |
"net/http" | |
"os" | |
) |
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
# app/uploaders/avatar_uploader.rb | |
process :fix_exif_rotation | |
process :strip | |
process :resize_to_fill => [1024, 768] | |
process :quality => 90 # Percentage from 0 - 100 |
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 'aws/s3' | |
require 'heroku' | |
require 'heroku/command' | |
require 'heroku/command/auth' | |
require 'heroku/command/pgbackups' | |
task :cron do | |
class Heroku::Auth | |
def self.client | |
Heroku::Client.new ENV['heroku_login'], ENV['heroku_passwd'] |
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
license: gpl-3.0 | |
redirect: https://observablehq.com/@d3/d3-marimekko-chart |
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
# Debian 6 bootstrap template file for chef | |
# | |
# Installs RVM and ruby enterprise edition (ree) patched to workaround | |
# issues with SSLv2 in debian systems (SSLv2 is deprecated) | |
# | |
# Also only installs ruby dependencies listed in `rvm notes` | |
# | |
# RVM is installed system-wide in /usr/local/rvm | |
# | |
# Usage: |
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
# yes, sometimes you need to do this. you get pilloried in a forum if you | |
# ask about it, though! | |
# this code taken from | |
# http://wholemeal.co.nz/blog/2011/04/05/rendering-from-a-model-in-rails-3/ | |
class MyModel < ActiveRecord::Base | |
# Use the my_models/_my_model.txt.erb view to render this object as a string | |
def to_s | |
ActionView::Base.new(Rails.configuration.paths.app.views.first).render( |
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 'bcrypt' | |
class User | |
include DataMapper::Resource | |
attr_accessor :password, :password_confirmation | |
timestamps :at | |
property :id, Serial |
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
include_recipe "postgresql::server90" | |
# inspiration from | |
# https://gist.github.com/637579 | |
execute "create-root-user" do | |
code = <<-EOH | |
psql -U postgres -c "select * from pg_user where usename='root'" | grep -c root | |
EOH | |
command "createuser -U postgres -s root" |
OlderNewer