Skip to content

Instantly share code, notes, and snippets.

View weavermedia's full-sized avatar

Dan Weaver weavermedia

View GitHub Profile
Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected header files:
# Create a CentOS 6.4 x64 droplet with minimal spec
# SSH in to new droplet
# Install ATRPMS Repository
rpm --import
rpm -ivh
# Install FFMPEG
weavermedia / Serve video depending on job status
Last active December 30, 2015 15:48
Serve original video or encoded versions depending on job status
# serve original video or encoded versions if the encoding job is complete
# using mutiple sources inside the <video> tag
<% orig = upload.direct_upload_url %>
<% mp4 = webm = jpg = nil %>
<% if upload.encode_is_complete %>
<% orig = nil %>
<% mp4 = upload.base_url + '.mp4' %>
<% webm = upload.base_url + '.webm' %>
weavermedia / Basic AWS S3 operations
Last active December 30, 2015 05:09
Basic AWS S3 operations
s3 =
bucket = s3.buckets['my_bucket']
# To duplicate an object within a bucket on S3
source_key = 'temp/file.txt'
destination_key = 'final/file.txt'
options = {:acl => :public_read} # use this to set the read permissions of the new object
bucket.objects[destination_key].copy_from(source_key, options)