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 env ARCHFLAGS="-Os -arch x86_64 -fno-common" gem install mysql -- --with-mysql-config=/opt/local/bin/mysql_config5 |
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/bash | |
mysql -uexampleuser -pletmein exampledb -B -e "select * from \`person\`;" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > filename.csv |
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
namespace :db do | |
namespace :fixtures do | |
desc 'Create YAML test fixtures from data in an existing database. | |
Defaults to development database. Set RAILS_ENV to override.' | |
task :dump => :environment do | |
sql = "SELECT * FROM %s" | |
skip_tables = ["schema_info"] | |
ActiveRecord::Base.establish_connection(:development) | |
(ActiveRecord::Base.connection.tables - skip_tables).each do |table_name| |
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
before(:each) do | |
@fanout = mock("fanout") | |
@binding = mock("binding", :subscribe => true) | |
@queue = mock("queue", :bind => @binding, :publish => true) | |
@amq = mock("AMPQueue", :queue => @queue, :fanout => @fanout) | |
@serializer = mock("Serializer", :dump => "dumped_value") | |
@target = mock("Target of Request") | |
@reaper = mock("Reaper") | |
Nanite::Reaper.stub!(:new).and_return(@reaper) | |
@request_without_target = mock("Request", :target => nil, :token => "Token", |
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
<?php | |
//You'd find it useful to resolve the http://bit.ly/aySVgM problem ;) | |
//Number of total rows | |
$tot_row=100; | |
//Spacer between the numbers | |
$spacer=' '; | |
//file where the pyramid will be saved | |
$file='triangle.txt'; |
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
//Adjust image size | |
//needs jquery | |
//put a #grid and #resizeme on your html and call $('#resizeme').resizeimg() | |
$.fn.resizeimg = function() { | |
//Define starting width and height values for the original image | |
var startwidth = 1280; | |
var startheight = 960; | |
//Define image ratio | |
var ratio = startheight/startwidth; | |
//Gather browser dimensions |