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
| (1..100000).each {|i| puts rand(100000)} |
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
| $ sed -e "s/.*,\([a-z.]\+@[a-z.]\+\).*/\1/g" file |
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
| # encodings: utf-8 | |
| =begin :rdoc | |
| = count_utf8.rb | |
| This script guesses the encoding of a csv file and print ratio of utf8 / size of the message | |
| The format of the csv file is the following | |
| id, replied_to_id, thread_id, timestamp, group, recipients, private, user_id, user, email_address, body, url, attachment_ids |
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
| #!/bin/bash | |
| # | |
| # generate a yammer weekly report | |
| # | |
| # usage | |
| # $ ./weeklyrep.sh <export_message.csv> | |
| # | |
| # 8/05/2011 [email protected] | |
| # |
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
| # encodings: utf-8 | |
| =begin :rdoc | |
| = code_detect.rb | |
| This script guesses the encoding of a csv file. | |
| The format of the csv file is the following | |
| 0:id, 1:replied_to_id, 2:thread_id, 3:timestamp, 4:group, 5:recipients, 6:private, 7:user_id, 8:user, 9:email_address, 10:body, 11:url, 12:attachment_ids |
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
| #!/bin/bash | |
| # | |
| # unzip csv file | |
| # | |
| # usage | |
| # $ ./unzip_csv.sh <export_message.zip> | |
| # | |
| # input format message_export_yyyymmdd-yyyymmdd.zip | |
| # output format data/messages_yyyymmdd-yyyymmdd.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
| # | |
| # fizzbuzz | |
| # author: [email protected] | |
| # 10/31/2011 | |
| # | |
| fz = ["fizzbuzz", 1, 2, "fizz", 4, "buzz", "fizz", 7, 8, "fizz", | |
| "buzz", 11, "fizz", 13, 14] | |
| (1..30).each {|i| p fz[i%15].class == String ? fz[i%15] : i} |
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
| # encodings: utf-8 | |
| =begin :rdoc | |
| = cut_f.rb | |
| This script prints a field of CSV file. | |
| The format of the csv file is the following | |
| id, replied_to_id, thread_id, timestamp, group, recipients, private, user_id, user, email_address, body, url, attachment_ids |