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
new_data = new_data.split(/\n/).collect {|v| v.split(/\|/)} |
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
%w(pp win32ole).each {|dep| require dep} | |
begin | |
$app = WIN32OLE.connect('Word.Application') | |
rescue Exception => e | |
$app = WIN32OLE.new('Word.Application') | |
end | |
$app.Visible = true | |
class WordConst |
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
$wd = WIN32OLE.new('Word.Application') | |
$wd.Visible = true | |
doc = $wd.Documents.Open(doc_file) |
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
#!/usr/bin/ruby | |
%w( win32ole pp date ).each { |dep| require dep } | |
doc = 'C:\Users\rdapaz\Dropbox\Karara\Schedule\K2 Master Schedule - Delayed FAT Scenario.mpp' | |
mpp = WIN32OLE.new('MSProject.Application') | |
mpp.Visible = true | |
mpp.FileOpen(doc) | |
tasks = [] | |
mpp.ActiveProject.Tasks.each do |tsk| |
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
convert sm_giga-01.jpg -gravity south \ | |
-stroke '#000C' -strokewidth 2 -annotate 0 'g33ky_b1ts' \ | |
-stroke none -fill white -annotate 0 'g33ky_b1ts' \ | |
polsm_giga-01.jpg |
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
Public Sub JoinCells() | |
Dim xls As Excel.Worksheet | |
Dim cell As Excel.Range | |
Dim destn_rge As Excel.Range | |
Dim combined As String | |
Dim i As Long | |
i = 0 | |
Set destn_rge = Nothing |
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
%w(pp win32ole).each { |dep| require dep } | |
db = 'C:\Users\rdapaz\Documents\Statement of Compliance.accdb' | |
cs = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=#{db};" | |
rs = WIN32OLE.new('ADODB.Recordset') | |
conn = WIN32OLE.new('ADODB.Connection') | |
conn.Open(cs) | |
rs.Open("[SoC]", conn, 1, 3) | |
conn.Execute("DELETE * FROM SoC") |
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
print "#{doc}: " | |
print "#{data.size > 1 ? data[0..-2].join(", ") : ""}#{data.size > 1 ? " and " : "" }#{data[-1].join("")}" if data.size > 0 | |
print "None" if data.size == 0 |
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
%w(win32ole date time).each { |dep| require dep } | |
def week_ending(tm) | |
# The <?Date> object passed in to week_ending is actually an instance of the Time class | |
new_tm = tm | |
offset = case new_tm.strftime('%a') | |
when "Mon" | |
6 | |
when "Tue" | |
5 |
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
# encoding: UTF-8 | |
%w(pp date).each { |dep| require dep } | |
def weird_date_todate(weird_date) | |
Date.new(weird_date.split(/\./)[2],weird_date.split(/\./)[1],weird_date.split(/\./)[0]) | |
end | |
puts weird_date_todate('14.10.2013') | |
# data = DATA |
OlderNewer