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
<% | |
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" | |
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}" | |
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --color --tags ~@wip" | |
%> | |
default: "<%= std_opts %> features" | |
wip: "--tags @wip:3 --wip features" | |
rerun: "<%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip" |
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
# original version, took approximatley 27 minutes. | |
lines = [] | |
File.open('zips-in.txt', 'r+') do |f| | |
f.each_line { |l| lines << l unless lines.include? l } | |
end | |
File.open('zips-out.csv', 'w+') do |f| | |
lines.each do |l| | |
f.write "#{l.split(',').join(' - ')},#{l}" |
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 'benchmark' | |
class Student | |
attr_accessor :name, :age | |
def initialize(args) | |
args.each do |k, v| | |
send("#{k}=".to_sym, v) | |
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
# Document being an active record model, and the test_data method returning a string. | |
# Is there a smarter way to organize this? Should i just use a local method in this step def file? | |
When /^I copy and paste a document$/ do | |
fill_in "content", Document.test_data | |
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
# used to quickly build a sql where condition to copy and paste. | |
"1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9".split(/\n/).collect { |c| "id='#{c}'" }.join(' OR ') |
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
$.ajax({ | |
url: '/combat_instance', | |
type: 'post', | |
beforeSend: function(jqXHR, settings) { | |
jqXHR.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content')); | |
}, | |
success: function(data) { | |
Game.CombatInstance.parseCreateData(data); | |
} | |
}); |
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 | |
class Model | |
{ | |
private $id; | |
private $data = Array(); | |
private $fieldNames = Array(); | |
public static function find($id) | |
{ | |
$tn = self::getTableName(); |
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
# AB Testing in pagetorrent | |
## Limitations of Test and target | |
- Cross domain requests | |
- Can cause tracking issues when clicking outbound links. The request doesnt finish before the link does. | |
- Difficulty tracking periodical tests. | |
- Expensive license | |
## Pluses of Test and target |
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
* { margin:0;padding:0;} | |
h1,h2,h3,h4,h5,p,li,a { font-size:12px;font-weight:normal;} | |
button, img { border:0; } | |
body { | |
font-family:Arial, sans-serif; | |
} |
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
@mixin content-middle { | |
width:1100px; | |
margin:0 auto; | |
} | |
.top { | |
height:123px; | |
background-color:#fff; | |
.content { | |
@include content-middle; |