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 helper should return an image for each bank, depending on the value of current | |
def show_bank_logo(current) | |
case current | |
when /barclay/ | |
logo_image = 'barclays' | |
when /coop/ | |
logo_image = 'cooperative' | |
when /hsbc/ |
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 'csv' | |
codes = [] | |
CSV.open("codes.csv", 'r') do |row| | |
# put the contents of the first column in each row in codes.csv, | |
# into the second column of each of codes | |
codes[row[1].to_i] = row[0] | |
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
<% @articles.each do |article| %> | |
<li> | |
<% form_for :article article do |f| -%> | |
<%= f.title %> - <%= f.published_at %> | |
<% end -%> | |
</li> | |
<% 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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'net/http' | |
require 'rio' | |
body = Net::HTTP.get 'minneapolisfuckingrocks.blogspot.com', '/2009/01/diplo-remix-collection.html' | |
links = body.scan(/http:\/\/[a-zA-Z0-9_\.\/]*mp3{1}/) | |
links.each {|link| rio(link) > rio(File.basename(link))} |
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 python | |
# encoding: utf-8 | |
""" | |
makewidget.py | |
Created by Chris Adams on 2009-03-03. | |
""" | |
from PIL import Image, ImageFont, ImageDraw |
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
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu---- | |
r b swpd free buff cache si so bi bo in cs us sy id wa | |
0 0 16584 7544 2212 37116 2 2 5 5 17 21 0 0 99 0 | |
0 0 16584 7544 2220 37108 0 0 0 8 10 13 0 0 100 0 | |
0 0 16584 7544 2220 37108 0 0 0 0 8 12 0 0 100 0 | |
0 0 16584 7544 2220 37108 0 0 0 0 9 15 0 0 100 0 | |
0 0 16584 7544 2228 37100 0 0 0 2 8 13 0 0 100 0 |
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
<Proxy balancer://loco> | |
BalancerMember http://localhost:15000 | |
BalancerMember http://localhost:15001 | |
BalancerMember http://localhost:15002 | |
BalancerMember http://localhost:15003 | |
BalancerMember http://localhost:15004 | |
</Proxy> | |
<VirtualHost *:80> | |
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
sudo aptitude search mysql | grep "^i" | |
i libdbd-mysql-perl - A Perl5 database interface to the MySQL da | |
i libmysqlclient15-dev - MySQL database development files | |
i libmysqlclient15off - MySQL database client library | |
i mysql-client-5.0 - MySQL database client binaries | |
i mysql-common - MySQL database common files | |
i mysql-server - MySQL database server (metapackage dependi | |
i mysql-server-5.0 - MySQL database server binaries | |
i php5-mysql - MySQL module for php5 |
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
#!/bin/sh | |
# check if the doord.pid is in the /var/run folder, showing that doord is running okay | |
cat /var/run/doord.pid | |
echo " " | |
# if cat shows up okay, then say we're cool, otherwise start doord again | |
if [ $? = 0 ] ; then | |
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
== AddAttachmentsPhotoToContent: migrating =================================== | |
-- add_column(:contents, :photo_file_name, :string) | |
rake aborted! | |
An error has occurred, all later migrations canceled: | |
Mysql::Error: Duplicate column name 'photo_file_name': ALTER TABLE `contents` ADD `photo_file_name` varchar(255) |
OlderNewer