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
| book = Spreadsheet.open('excel-2k4-copy.xls') | |
| [0,1].map { |n| book.worksheet(n) }.each do |sheet| | |
| # Let's copy us some rows! | |
| 18.upto(25) do |n| | |
| base = n.even? ? 14 : 15 | |
| sheet.row(base).formatted.formats.size.times do |f| | |
| #puts "#{n} #{f}" | |
| sheet[n, f] = '' | |
| sheet.row(n).set_format(f, sheet.row(base).formatted.formats[f]) | |
| 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
| awk 'BEGIN { FS = "\t" } ; { print NF-1 }' huge_file.csv |
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
| #!/usr/bin/env ruby | |
| numbers = %w{ | |
| 73167176531330624919225119674426574742355349194934 | |
| 96983520312774506326239578318016984801869478851843 | |
| 85861560789112949495459501737958331952853208805511 | |
| 12540698747158523863050715693290963295227443043557 | |
| 66896648950445244523161731856403098711121722383113 | |
| 62229893423380308135336276614282806444486645238749 | |
| 30358907296290491560440772390713810515859307960866 |
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
| class Post < ActiveRecord::Base | |
| acts_as_taggable_on :categories | |
| # To deal with a single tag type... | |
| scope_procedure :taggable_with_categories, lambda { |tags| | |
| tagged_with(tags, :on => :categories) | |
| } | |
| # Or, deal with all your tag types... | |
| if respond_to?(:tag_types) |
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
| $("#edit_station_1 > #station_active").bind("change", function() { alert("hi"); }); |
NewerOlder