This file contains hidden or 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 you have an xml representation of a data entity, and need to convert to CSV, this script works pretty well. | |
| # Specify the file name of an xml file, and the node name of the object. So if you have an XML file of <Person> objects that has all the fields in child elements. | |
| # Specify the Person node, and it will iterate through to create a csv. Each person will be a separate row. | |
| require 'rubygems' | |
| require 'nokogiri' | |
| puts 'type xml file name' | |
| xml_name = gets.chomp | |
| f = File.open(xml_name) |
This file contains hidden or 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
| module Redcar | |
| class Sparkup | |
| def self.plugin_dir | |
| File.join(File.dirname(__FILE__), "..") | |
| end | |
| attr_accessor :indent_spaces |
This file contains hidden or 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; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |