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
class Fixnum | |
def to_d | |
self.to_f.to_d | |
end | |
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
# load 'selenium.rb', true | |
require 'rubygems' | |
require 'capybara' | |
require 'capybara/dsl' | |
include Capybara::DSL | |
Capybara.default_driver = :selenium | |
visit "http://localhost:3000" | |
fill_in "Email", :with => 'username@example.com' | |
fill_in "Password", :with => 'some_pass' |
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
rvm is a function | |
rvm () | |
{ | |
local result; | |
__rvm_setup; | |
case $- in | |
*i*) | |
rvm_interactive_flag=1 | |
;; | |
*) |
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
MariaDB [btt]> select * from searches into outfile '/var/tmp/out'; | |
Query OK, 26292 rows affected (0.04 sec) | |
MariaDB [btt]> show session status like '%cost%'; | |
+-----------------+-------------+ | |
| Variable_name | Value | | |
+-----------------+-------------+ | |
| Last_query_cost | 5409.399000 | | |
+-----------------+-------------+ | |
1 row in set (0.00 sec) |
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
MariaDB [btt]> select * from searches; | |
+----+--------------+---------------------+---------------------+ | |
| id | query | created_at | updated_at | | |
+----+--------------+---------------------+---------------------+ | |
| 1 | Nitrodist | 2011-11-30 10:44:53 | 2011-11-30 10:44:53 | | |
| 2 | MurrayMoman | 2011-11-30 10:45:02 | 2011-11-30 10:45:02 | | |
| 3 | Juiceman8181 | 2011-11-30 10:45:08 | 2011-11-30 10:45:08 | | |
+----+--------------+---------------------+---------------------+ | |
3 rows in set (0.00 sec) |
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
mark@linux-qmbm proj (master)$ bundle install | |
Fetching gem metadata from http://rubygems.org/....... | |
Fetching gem metadata from http://rubygems.org/.. | |
Bundler could not find compatible versions for gem "bundler": | |
In Gemfile: | |
validates_overlap (>= 0) ruby depends on | |
bundler (~> 1.0.0) ruby | |
Current Bundler version: | |
bundler (1.1.rc) |
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
$(function() { | |
$("form").submit(function() { | |
var q = $("#search_q").val(); | |
if (q == "") | |
return false; | |
$.getJSON("/definitions", { q: q }, function(json) { | |
$("#definition_results").prepend("<li class='hidden'>" + | |
"<dl>" + | |
"<dt>" + json.title + "</dt>" + |
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
http://en.wikibooks.org/wiki/X86_Assembly/GAS_Syntax | |
mark@linux-qmbm ~$ cat hello.c | |
#include <stdio.h> | |
int main(void) { | |
printf("Hello, world!\n"); | |
return 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
mark@linux-qmbm ~/rubyapps/rails (master)$ grep -r -i 'rbconfig' * | grep -v 'host_os' | grep -v 'require' | sort | |
actionmailer/Rakefile: ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME')) | |
actionpack/test/ts_isolated.rb: ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME')) | |
activemodel/Rakefile: ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME')) | |
activerecord/Rakefile: ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME')) | |
activeresource/Rakefile: ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME')) | |
activesupport/test/isolation_test.rb: OUTPUT = `#{RbConfig::CONFIG["bindir"]}/#{RbConfig::CONFIG["ruby_install_name"]} -I#{File.dirname(__FILE__)} "#{File.expand_path(__FILE__)}" -v` | |
activesupport/test/ts_isolated.rb: ruby = File.join(*RbConfig::CONFIG.values_at('bindir', 'RUBY_INSTALL_NAME')) | |
railties/guides/source/initialization.textile: RUBY = File.join(*RbConfig::CONFIG.val |
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
use Bank; | |
SELECT client.client_id, account.account_no, COUNT(transactions.account_no) | |
FROM client, account, transactions | |
WHERE client.client_id = account.client_id AND | |
account.account_no = transactions.account_no | |
GROUP BY client.client_id, account.account_no | |
ORDER BY 3 DESC; |