This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is for zsh so you might have to change for other shells but general idea is the same | |
Note: Change 'ClassPath' to the root of your project | |
chpwd () { | |
case $PWD in | |
*ClassPath*) | |
python -c 'import sys; print sys.real_prefix' 2>/dev/null 1>/dev/null || source bin/activate | |
esac | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#decode base64 | |
Dir.mkdir('decoded_photos/') | |
Dir.foreach('./photos') do |item| | |
next if !item.match(/.*_signature_image/) | |
base64_encoded = File.read("photos/" + item) | |
decocded = Base64.decode64(base64_encoded.split(',')[1]) | |
File.open("decoded_photos/#{item}.png", 'wb') do |file| | |
file.write(decocded) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bucket = Storage.fetch.buckets["postcard_batch"] | |
Dir.mkdir('photos/') | |
bucket.objects.each do |obj| | |
File.open("photos/#{obj.key}.png", 'wb') do |file| | |
obj.read do |chunk| | |
file.write(chunk) | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bucket = Storage.fetch.buckets["postcard_batch"] | |
Dir.mkdir('photos/') | |
bucket.objects.each do |obj| | |
File.open("photos/#{obj.key}", 'wb') do |file| | |
obj.read do |chunk| | |
file.write(chunk) | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hey! | |
Currently, a collection is recognized by the rules.js "collection" rule-- The el has a child that is the singular version | |
of itself. | |
This adds a cognitive load because it adds a conidtional to another rule:the model/scoping rule. | |
The model/scoping rule without collections: 'A dom elem with a class that ends in a dash will bind the children | |
of that dom element to the child of that name of the current model in scope' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add EndDash.View.extend | |
== Client can call EndDash.view.extend({ | |
.... Normal Backbone View things .... | |
}) | |
Under the hood will return "Backbone.View.extend({ | |
.... Same Normal Backbone View things .... | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs') | |
, path = require('path') | |
, _ = require('underscore') | |
, outputPath = __dirname | |
, filesToParse = 0 | |
, callback | |
var compressFiles = function(templatesLocation, outputPath, callback) { | |
if (arguments.length != 3) { | |
throw new Error("All three arugments are required") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 #!/bin/bash | |
2 pushd ~/Amicus/suspendors_project/suspendersTest/client_side_js | |
3 if [ -e "bundle.js" ] | |
4 then | |
5 echo "removing old bundle.js" | |
6 rm -f bundle.js | |
7 fi | |
8 if [ -e "main.js" ] | |
9 then | |
10 echo "removing old bundle.js" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7:29:15 BUILDER: devon, staging, brief:oct3_integration: restarting first service | |
COMMAND: sudo su deploy sg apps -c 'cd -P /mnt/services/brief/current && TORQUEBOX_HOME=/mnt/torquebox/current JBOSS_HOME=/mnt/torquebox/current/jboss JRUBY_HOME=/usr/bin/jruby /usr/bin/jruby/bin/jruby -S torquebox deploy --name=brief-service .' | |
status: 1; err: ; out: Errno::EACCES: Permission denied - Permission denied | |
utime at org/jruby/RubyFile.java:1040 | |
touch at /usr/local/share/jruby-1.7.2/lib/ruby/1.9/fileutils.rb:1146 | |
each at org/jruby/RubyArray.java:1613 | |
touch at /usr/local/share/jruby-1.7.2/lib/ruby/1.9/fileutils.rb:1143 | |
deploy_yaml at /usr/local/share/jruby-1.7.2/lib/ruby/gems/shared/gems/torquebox-rake-support-2.3.0/lib/torquebox/deploy_utils.rb:317 | |
deploy at /usr/local/share/jruby-1.7.2/lib/ruby/gems/shared/gems/torquebox-2.3.0/bin/torquebox:112 | |
__send__ at org/jruby/RubyBasicObject.java:1665 |