Skip to content

Instantly share code, notes, and snippets.

View oheyandy's full-sized avatar

Andrew Frauen oheyandy

  • Salesforce
  • San Francisco
View GitHub Profile
@oheyandy
oheyandy / send_test.py
Last active December 16, 2015 01:09
Simple script to test Desk.com/Assistly x-headers.
import smtplib
from email.MIMEText import MIMEText
text_subtype = 'text'
# Enter the desired body in the 'content' variable
content = 'body of the email here'
msg = MIMEText(content, text_subtype)
@oheyandy
oheyandy / change_name.rb
Created April 10, 2013 09:27
Whew. My (admittedly ugly looking) first attempt at using Ruby to loop through directories and append a 0 to .png files names 1.png, 2.png, etc.
d = Dir.new(Dir.pwd)
d.each do |x|
if File.directory?(x) && x != "." && x!= ".."
Dir.chdir("./"+File.basename(x))
to_change = Dir.glob("[0-9].png")
to_change.each { |x| File.rename(x, 0.to_s + x) }
to_change_small = Dir.glob("small-[0-9].png")
to_change_small.each { |x| File.rename(x, x[0,6] + 0.to_s + x[6,7]) }
Dir.chdir("../")