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
''' quick example showing how to attach a pdf to multipart messages | |
and then send them from SES via boto | |
''' | |
from email.mime.text import MIMEText | |
from email.mime.application import MIMEApplication | |
from email.mime.multipart import MIMEMultipart | |
import boto |
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
# get flashcard file | |
if (@ARGV > 0) { | |
$f=$ARGV[0]; | |
} else { | |
die "Usage: perl flashcard.pl <pipedelimitedflashcardfile>\n"; | |
} | |
# read flashcard file | |
open (FILE,"$f"); | |
@lines=<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
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris molestie eros. Nullam at justo quis eros feugiat blandit. Nulla sed nunc. Sed quis purus. Suspendisse potenti. Phasellus in ante. Cras ut nibh. Nulla ut odio. Phasellus mauris. In eu lectus eu dolor egestas tempus. Integer aliquam. Phasellus accumsan. Sed iaculis lacus in lacus. Aliquam erat volutpat. Vestibulum nulla enim, pharetra sit amet, tincidunt et, bibendum id, magna. Aenean elit. Vivamus nunc. |
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
rm -f 'c:/ibm/WebSphere/profiles/wp_profile/temp/wps.ear'; | |
rm -r -f 'c:/ibm/WebSphere/profiles/wp_profile/temp/wps_expanded/'; | |
mkdir -p 'c:/ibm/WebSphere/profiles/wp_profile/temp/wps_expanded/'; | |
cd 'c:/ibm/WebSphere/profiles/wp_profile/temp'; | |
'C:\\ibm\\WebSphere\\profiles\\wp_profile\\bin/wsadmin.bat' -username phurnace -password password -c '$AdminApp export wps c:/ibm/WebSphere/profiles/wp_profile/temp/wps.ear'; | |
'C:\\ibm\\WebSphere\\profiles\\wp_profile\\bin/EARExpander.bat' -ear c:/ibm/WebSphere/profiles/wp_profile/temp/wps.ear -operationDir 'c:/ibm/WebSphere/profiles/wp_profile/temp/wps_expanded' -operation expand; | |
rm -f 'c:/ibm/WebSphere/profiles/wp_profile/temp/wps.ear'; | |
cd 'c:/ibm/WebSphere/profiles/wp_profile/temp/wps_expanded/wps.war'; | |
rm -r -f './skins/html/qaThinSkin'; |
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
# convert_csv_to_testlink.rb | |
# | |
# author: Cynthia Sadler | |
# usage: ruby convert_csv_to_testlink.rb infile.csv outfile.xml | |
# | |
# where infile.cvs is a comma-separated-value file with four fields: | |
# name, summary, steps, expected results | |
# | |
# The steps field and expected results field may have multiple steps. If | |
# multiple steps are used, use newlines to delimit the steps, and enclose |
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
infile = ARGV[0] | |
outfile = "" | |
open(infile) {|f| | |
f.to_a.each do |line| | |
outfile += line.gsub(/\s+/, ",").chop + "\n" | |
end | |
} | |
puts outfile |
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
new_file = File.new(filename, "w+") | |
new_file.puts new_script | |
new_file.close | |
system "dos2unix #{filename}" |
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
new_script.gsub(/\r\n/, "\n") #convert DOS line feeds to unix format | |
new_file = File.new(filename, "w+") | |
new_file.puts new_script | |
new_file.close |
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 'find' | |
argv = ARGV.empty? ? %w{.} : ARGV | |
file_counts = Hash.new(0) | |
files = Array.new | |
Find.find(*argv) do |fullname| | |
# looking for image files only | |
next unless fullname =~ /\.(JPEG|JPG|GIF|MOV)$/i | |
file = File.basename(fullname).downcase |