Skip to content

Instantly share code, notes, and snippets.

site = "www.website.com"
months = ["www.website.com/awstats042009.www.website.com.txt", "www.website.com/awstats052009.www.website.com.txt"]
# below works better
months.map! { |m| m[/#{site}\/awstats([0-9]{6})\.#{site}\.txt/,1] }
puts months
mysql> describe shipped_order;
+---------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| ship_to_address | varchar(255) | YES | | NULL | |
| total_weight | bigint(20) | YES | | NULL | |
| ups_tracking_number | bigint(20) | YES | | NULL | |
| real_shipping_costs | varchar(10) | YES | | NULL | |
| processing_date | date | YES | | NULL | |
@bval
bval / gist:768472
Created January 6, 2011 20:01 — forked from cwage/gist:768464
sfGuardUser:
sgu_admin:
username: admin
password: Client2009
is_super_admin: true
cwage:
username: cwage
password: changeme
first_name: Chris
last_name: Wage
sfGuardUser:
sgu_admin:
username: admin
password: Client2009
is_super_admin: true
cwage:
username: cwage
password: changeme
first_name: Chris
last_name: Wage
Employee:
columns:
id:
type: integer
primary: true
autoincrement: true
sf_guard_user_id:
type: integer
start_date:
type: date
<?php
/**
* Department form.
*
* @package skeleton
* @subpackage form
* @author Your name here
* @version SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
*/
class ApplicationController < ActionController::Base
protect_from_forgery
private
def current_user_session
@current_user_session ||= UserSession.find
end
def current_user
current_user_session && current_user_session.user
it "fails" do
fail "hey buddy, you should probably rename this file and start specing for real"
end
[ ["-71", "-49"], ["-47", "-37"], ["-73"] ] =returns=> [ ["-71", "-47", "-73"] ["-71", "-37", "-73"] ["-49", "-47", "-73"] ["-49", "-37", "-73"] ]
or
[
["-71", "-49"],
["-47", "-37"],
["-73"]
]
returns
[
@bval
bval / gist:2239660
Created March 29, 2012 16:42
HTML Salutations
<select name="salutation" size="1">
<option value="">
-- please make a selection --
</option>
<option value="Admiral">
Admiral
</option>
<option value="Ambass. &amp; Mrs.">