Skip to content

Instantly share code, notes, and snippets.

View creativetechnologist's full-sized avatar

Richard Smith creativetechnologist

View GitHub Profile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.3'
# Use sqlite3 as the database for Active Record
gem 'mysql2'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
GEM
remote: https://rubygems.org/
specs:
actionmailer (4.2.3)
actionpack (= 4.2.3)
actionview (= 4.2.3)
activejob (= 4.2.3)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 1.0, >= 1.0.5)
actionpack (4.2.3)
GIT
remote: git://github.com/activerecord-hackery/polyamorous.git
revision: 69ce1f436ee93dcb011631bb727a6e3ab38a27f4
specs:
polyamorous (1.0.0)
activerecord (>= 3.0)
GIT
remote: git://github.com/activerecord-hackery/ransack.git
revision: c427b4865d8b47ff85545cf1ba0c5cf7ae211e4b
GIT
remote: git://github.com/ernie/ransack.git
revision: 3add178bd26a73e0e18c7bed291c2ccccab08500
specs:
ransack (1.6.2)
actionpack (>= 3.0)
activerecord (>= 3.0)
activesupport (>= 3.0)
i18n
polyamorous (~> 1.1)
cap production deploy
* 2015-01-19 15:22:12 executing `production'
* 2015-01-19 15:22:12 executing `deploy'
* 2015-01-19 15:22:12 executing `deploy:update'
** transaction: start
* 2015-01-19 15:22:12 executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote git@github.com:creativetechnologist/bondcube.git master"
command finished in 1668ms
* executing "if [ -d /home/rails/BondcubeProduction/shared/cached-copy ]; then cd /home/rails/BondcubeProduction/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard a2bf5ec34715bfaf022c3c1dcd6abc26e56bffd1 && git clean -q -d -x -f; else git clone -q -b master git@github.com:creativetechnologist/bondcube.git /home/rails/BondcubeProduction/shared/cached-copy && cd /home/rails/BondcubeProduction/shared/cached-copy && git checkout -q -b deploy a2bf5ec34715bfaf022c3c1dcd6abc26e56bffd1; fi"
ftpupload.how_many_retries.times do
begin
Net::SFTP.start(ftpupload.host, ftpupload.username) do |sftp|
sftp.upload!(filename, "/")
AdminMailer.notifyadmins("Succesfully sent File to JDW","Sent File to JDW: #{filename}").deliver
puts "sent file up"
end
break
rescue Exception=>e
@creativetechnologist
creativetechnologist / gist:5686479
Created May 31, 2013 17:21
Script for Ben to process email files
# Script for Ben to process email files
# By: Richard G Smith
# Running notes
# 1. Copy this script into the folder containing the input csv file, eg. vinciparser.rb
# 2. Change the two constants, INPUT_FILE_NAME and OUTPUT_FILE_NAME to the desired values
# 3. At the command prompt type ruby vinciparser.rb
# 4. All going well you should have a new file in your folder named as per OUTPUT_FILE_NAME
# Requirements to run the script
# Ensure input file is UFT-8 encoded
@creativetechnologist
creativetechnologist / ruby-guitar-chords
Created November 6, 2012 15:43
Simple ruby script to randomly show guitar chords on the terminal to assist with learning/practicing
# Simple Ruby script to dish out pre-defined guitar chords on the terminal to
# assist with learning
# Change these to the chords you want, notice some chords are in here twice;
# this is so it generates twice as many of them as I am/was finding them the
# hardest to navigate to on the fretboard.
trap("SIGINT") { throw :ctrl_c }
CHORDS = ["A","B","C","D","E","F","G","Am","Bm","Cm","Dm","Bm","Cm","Dm","B","Fmaj7"]
@creativetechnologist
creativetechnologist / rubymotion_ispeech
Created July 19, 2012 13:43
Integrating RubyMotion and the iSpeech SDK
As of 19th July 2012, RubyMotion has a couple of issues with external libraries as I discovered when trying the integration, thanks to Laurent, the architect of RubyMotion and with some prompting from Stéphane Wirtel here is the issue and resolution including the code to make the iPhone speak.
Firstly setting up the app, assuming you've already copied the files you need into your vendor/iSpeechSDK directory this is the code needed in the rakefile as per any normal library ...
app.vendor_project('vendor/iSpeechSDK', :static,
:products => ["libiSpeechSDK.a"],
:headers_dir => "Headers")
However, the bundle file which should be in the directory won't be picked up by RubyMotion which doesn't become apparent until you try and instantiate the object, to avoid this issue move the file iSpeechSDK.bundle into the /resources directory on the project root.