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
<!--PIE:CSS3 rendering for IE Version 1.0beta3 http:Dual-licensed for use under the Apache License Version 2.0 or the General Public License(GPL)Version 2.--><PUBLIC:COMPONENT lightWeight="true"><PUBLIC:ATTACH EVENT="oncontentready"FOR="element"ONEVENT="init()"/><PUBLIC:ATTACH EVENT="ondocumentready"FOR="element"ONEVENT="init()"/><PUBLIC:ATTACH EVENT="ondetach"FOR="element"ONEVENT="cleanup()"/><script type="text/javascript">var doc=element.document;var PIE=window['PIE'];if(!PIE){PIE=window['PIE']={CSS_PREFIX:'-pie-',STYLE_PREFIX:'Pie',CLASS_PREFIX:'pie_',tableCellTags:{'TD':1,'TH':1}};try{doc.execCommand('BackgroundImageCache',false,true)}catch(e){}PIE.ieVersion=function(){var v=4,div=doc.createElement('div'),all=div.getElementsByTagName('i');while(div.innerHTML='<!--[if gt IE '+(++v)+']><i></i><![endif]-->',all[0]){}return v}();if(PIE.ieVersion===6){PIE.CSS_PREFIX=PIE.CSS_PREFIX.replace(/^-/,'')}PIE.ie8DocMode=PIE.ieVersion===8&&doc.documentMode;PIE.Util={createVmlElement:function(tag){var vmlPrefix='css3vml |
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
// Had an interesting problem today by trying to load a textarea's contents as dom elements. | |
// Here's what I did: | |
// get my value and convert into a dom element | |
var string = $('#article_body').val(); | |
var element = $("<div>" + string + "</div>"); | |
// from there, I can get what I need | |
element.find("video").attr('src'); |
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
default_dev: &default_dev | |
adapter: postgresql | |
host: localhost | |
database: db | |
pool: 500 | |
username: user | |
password: pass | |
timeout: 25000 | |
<%= file = File.join(Rails.root.to_s, "../config", "dev.yml") | |
IO.read(file) if File.exist?(file) %> |
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
> bundle install | |
... | |
Installing mysql (x.x.x) with native extensions | |
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. | |
> bundle config build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config | |
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
Factory.sequence :email do |n| | |
"test#{n}@example.com" | |
end | |
Factory.sequence :username do |n| | |
"user#{n}" | |
end | |
Factory.sequence :visitor_token do |n| | |
"token#{n}" |
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
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM | |
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM | |
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM | |
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM | |
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM | |
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM | |
MMMNNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNZOOO88DDDDDDDNNNNNDD88OOOOOO8DNNMMMMMMMNNNNDZZNNNNNNNNDDD8D77ZND8MMMMN87I77$OO | |
MMMMNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMZ8888DDDDDNNNNNNNNNDDOO8D88888Z77ZZDNNMMMNMMM88D8OZ8DDDNNNNNZ88D8MMMMMO$I77$ZDNM | |
MMMMNNNMMMMMMMMN8DMNNDDNNMMMMMMMMMMMMMNO8D8DDDDNDNNNNNN |
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
Sequel.migration do | |
change do | |
create_table :polls do | |
primary_key :id | |
string :title | |
string :author | |
boolean :active | |
end | |
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
if pid = params[:pid] | |
if `ps -o state -p #{pid.to_i} | tail +2` =~ /S+/ | |
sleep(5) | |
redirect_to :action => :get_report, :pid => pid, :name => params[:name] | |
return | |
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
,:$?ZZZ~$,,,=$:OZZ=Z,.,,=Z:ZZ,,,,$O~ZZ,OO,,.,,ZZZZ~,,,,,Z=O$Z+O$,,,,,,,,,,,,,,,. | |
,,Z:$,ZOZ,,,,Z,$~$~Z,,,.,$,O,,,,,+?7=Z:Z?,,.,+O+Z?7,,,,,,Z:Z$O7,,,,,,,,,,,,,,,,. | |
,,$.:~Z,..,.,Z,,,:Z:,,,,,Z~$..,,,Z,Z,Z,Z,,,,,Z=Z$,Z,,,,.,OZ+O:,,,,,,,,,,,,,,,,,. | |
,~Z?ZZI,,..,I+Z$Z:O,...,??7~,,,,,Z,Z~$=Z,,,,Z:$ZO~$,,,,,,+Z7Z,,,,,,,,,,,,,,,,,,. | |
~Z~Z$,,,.,,?$:$$$~Z$,,,+$:$Z,,.,ZZ+$ZZ$Z,..ZZZ$,Z?ZZ,,,,,Z7$$,,,,,,,,,,,,,,,,,,. | |
$$$$Z,,,,,,$Z$$7$Z$Z.,.Z$Z$7,,..$Z$ZZ$:,,.,Z$ZOIZ$$Z..,,?ZZ$O,,,,,,,,,,,,,,,,,,. | |
...............+?7++ON??+??I?????+8...,..,..............,...,................... | |
...........,,.~$+?$$8D$++?????????++............................................ | |
.............~+NIZZIO,8?7???++I????+D..............,.......,.................... |
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
[7] pry(main)> range = ((Date.today - 1000.years)..(Date.today + 1000.years)) | |
=> Sun, 26 Oct 1012..Mon, 26 Oct 3012 | |
[11] pry(main)> target = (Date.today + 999.years) | |
=> Sat, 26 Oct 3011 | |
[12] pry(main)> Benchmark.measure { range.include? target } | |
=> 0.410000 0.000000 0.410000 ( 0.411619) | |
[13] pry(main)> Benchmark.measure { range === target } |
OlderNewer