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 'fileutils' | |
require 'filemagic' | |
fm = FileMagic.new | |
entries = Dir.glob('*').select {|f| File.directory? f} | |
entries.each do |dir| | |
puts "PWD: #{Dir.pwd}" | |
Dir.chdir(dir) | |
puts "PWD: #{Dir.pwd}" |
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 'nokogiri' | |
def convert | |
name = '/home/benjamin/Downloads/msn_file_name.xml' | |
File.open('/home/benjamin/Downloads/result.txt', 'w+') do |f| | |
doc = Nokogiri::XML(File.read(name)) | |
doc.xpath('//Message').each do |message| | |
from = message.at_xpath('From/User/@FriendlyName') | |
to = message.at_xpath('To/User/@FriendlyName') | |
content = message.at_xpath('Text').content |
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
set nocompatible " be iMproved, required | |
filetype off " required | |
set enc=utf8 | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') |
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
cat log/production.log| grep "^Completed .* in [0-9]*ms .*" | sed "s/.* in \([0-9]*\)ms.*/\1/" | awk '{ s += $1 } END { print "sum: ", s, " average: ", s/NR, " samples: ", NR }' |