Skip to content

Instantly share code, notes, and snippets.

<% if current_user.present? %>
var userId = "<%= current_user.id %>"
var name = "<%= name %>";
var email = "<%= current_user.email %>";
var postcode = "<%= current_user.postcode %>";
var numberOrders = "<%= current_user.number_completed_orders %>";
// This is an example script - don't forget to change it!
FS.identify(userId, {
displayName: name,
email: email,
@frankmt
frankmt / gist:8813291
Created February 4, 2014 22:06
Script - Spree deployment with asset recompilation
#!/bin/sh
read -r -p "Confirm deployment to PRODUCTION? Type 'yes' to continue " response
if [[ $response == "yes" ]]
then
# Precompile assets and commit to github
bundle exec rake assets:precompile RAILS_ENV=production
git add .
git commit -m 'recompiling assets'
git push origin master
@frankmt
frankmt / .powrc
Last active December 21, 2015 18:48
if [ -f "$rvm_path/scripts/rvm" ]; then
source "$rvm_path/scripts/rvm"
if [ -f ".rvmrc" ]; then
source ".rvmrc"
fi
if [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
fi
function AttachmentCtrl($scope, $location, $timeout, Docs) {
$(function() {
$('#detail-form-doc').fileupload({
dataType: 'json',
url: '/angular-ib/app/fileupload?id=' + $location.search().id,
add: function(e, data) {
$scope.$apply(function(scope) {
// Turn the FileList object into an Array
for (var i = 0; i < data.files.length; i++) {
$scope.project.files.push(data.files[i]);
@frankmt
frankmt / gist:4214497
Created December 5, 2012 10:16
Lbl Setup
wget -O lbl.dump `heroku pgbackups:url --app livebelowtheline`
--2012-12-05 21:09:30-- https://s3.amazonaws.com/hkpgbackups/app2617661@heroku.com/a311.dump?AWSAccessKeyId=AKIAIYZ2BP3RBVXEIZDA&Expires=1354702770&Signature=kRPBYEWap9ZtiUApvNz%2FTi28pck%3D
Resolving s3.amazonaws.com... 207.171.189.80
Connecting to s3.amazonaws.com|207.171.189.80|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 19561402 (19M) [binary/octet-stream]
Saving to: `lbl.dump'
100%[==================================================================================================================================>] 19,561,402 309K/s in 66s
@frankmt
frankmt / gist:3628915
Created September 5, 2012 01:29
Bundle install not working
The command you ran: bundle install
Exception backtrace:
/Users/frankmt/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/net/http.rb:560:in `initialize': getaddrinfo: nodename nor servname provided, or not known (SocketError)
from /Users/frankmt/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/net/http.rb:560:in `open'
from /Users/frankmt/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/net/http.rb:560:in `connect'
from /Users/frankmt/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/timeout.rb:53:in `timeout'
from /Users/frankmt/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/timeout.rb:101:in `timeout'
from /Users/frankmt/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/net/http.rb:560:in `connect'
from /Users/frankmt/.rvm/rubies/ruby-1.8.7-p358/lib/ruby/1.8/net/http.rb:553:in `do_start'
#
# cucumber.yml
#
# Filter which features are run with each profile by the file extension
webrat: --require features/steps/common --require features/support/webrat_env.rb --exclude selenium.feature --format progress
selenium: --require features/steps/common --require features/support/selenium_env.rb --exclude webrat.feature --format progress
#
# features/support/env.rb
1)
'Performance complaints back end rejecting a performance removes performance entirely, removes complaint from moderation page and audits created for rejection/entry withdrawal when you reject the perf' FAILED
expected: 0,
got: -1 (using ==)
<a href="/projects/code/1c2f/spec/story/010_performance_complaints_spec.rb?line=151#151">./spec/story/010_performance_complaints_spec.rb:151</a>:
2)
'favourites should be able to favourite a performance and a rejected performance is not in you favourites' FAILED
expected false, got true
<a href="/projects/code/1c2f/spec/story/021_favourites_spec.rb?line=36#36">./spec/story/021_favourites_spec.rb:36</a>:
~ Started request handling: Thu Nov 27 14:10:54 +0000 2008
~ Routed to: {"Filename"=>"1c2f_home.flv", "action"=>"create", "_1c2f"=>"553ec933272df588cbd2ea0410eb761d", "Upload"=>"Submit Query", "controller"=>"performance_uploads", "performance_upload"=>{"category"=>"1", "raw_filename"=>{"size"=>"5034653", "filename"=>"/tmp/0000740755"}, "terms_and_conditions"=>"1", "title"=>"fd", "description"=>"gdf"}}
~ Params: {"Filename"=>"1c2f_home.flv", "action"=>"create", "_1c2f"=>"553ec933272df588cbd2ea0410eb761d", "Upload"=>"Submit Query", "controller"=>"performance_uploads", "performance_upload"=>{"category"=>"1", "raw_filename"=>{"size"=>"5034653", "filename"=>"/tmp/0000740755"}, "terms_and_conditions"=>"1", "title"=>"fd", "description"=>"gdf"}}
~ ************** starting session hack
~ Merb::ActiveRecordSessionStore Load (0.000703) SELECT * FROM `sessions` WHERE (`sessions`.`session_id` = '553ec933272df588cbd2ea0410eb761d') LIMIT 1
~ ************** finishing session hack
~ Member Load (0.002657)