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:
/usr/local/include/node/android-ifaddrs.h
/usr/local/include/node/ares.h
/usr/local/include/node/ares_build.h
/usr/local/include/node/ares_rules.h
/usr/local/include/node/ares_version.h
# Create a CentOS 6.4 x64 droplet with minimal spec
# SSH in to new droplet
# Install ATRPMS Repository
rpm --import http://packages.atrpms.net/RPM-GPG-KEY.atrpms
rpm -ivh http://dl.atrpms.net/all/atrpms-repo-6-7.el6.x86_64.rpm
# Install FFMPEG
@weavermedia
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
weavermedia / Basic AWS S3 operations
Last active December 30, 2015 05:09
Basic AWS S3 operations
s3 = AWS::S3.new
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)