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
| set :rails_env, :production | |
| set :unicorn_binary, "/usr/bin/unicorn" | |
| set :unicorn_config, "#{current_path}/config/unicorn.rb" | |
| set :unicorn_pid, "#{current_path}/tmp/pids/unicorn.pid" | |
| namespace :deploy do | |
| task :start, :roles => :app, :except => { :no_release => true } do | |
| run "cd #{current_path} && #{try_sudo} #{unicorn_binary} -c #{unicorn_config} -E #{rails_env} -D" | |
| end | |
| task :stop, :roles => :app, :except => { :no_release => true } do |
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
| #!/usr/bin/env bash | |
| # | |
| # install all of http://github.com/phuibonhoa's TM bundles (OS X only) | |
| # | |
| echo "Installing bundles..." | |
| # backup dir | |
| if [ -d ~/desktop/_tm_bundle_backups ]; then rm -rf ~/desktop/_tm_bundle_backups; fi |
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
| # create the template | |
| template = PageOfflineTemplate.new | |
| template.quote = quote | |
| template.pages = quote.build_pages | |
| # Here I render a template with layout to a string then a PDF | |
| pdf = PDFKit.new template.render_to_string(:template=>"quotes/review.html.haml") | |
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
| module Mongoid | |
| class Criteria | |
| include Criterion::MapReduce | |
| 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
| /* The API controller | |
| Exports 3 methods: | |
| * post - Creates a new thread | |
| * list - Returns a list of threads | |
| * show - Displays a thread and its posts | |
| */ | |
| var Thread = require('../models/thread.js'); | |
| var Post = require('../models/post.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
| # .chef/knife.rb | |
| # SEE: http://wiki.opscode.com/display/chef/Troubleshooting+and+Technical+FAQ | |
| # set some sensible defaults | |
| current_dir = File.dirname(__FILE__) | |
| user = ENV['OPSCODE_USER'] || ENV['USER'] | |
| log_level :debug | |
| log_location STDOUT | |
| node_name `hostname` | |
| client_key '' |
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
| user = ENV['OPSCODE_USER'] || ENV['USER'] | |
| base_box = ENV['VAGRANT_BOX'] || 'centos-5.5-x86_64' | |
| Vagrant::Config.run do |config| | |
| config.vm.define :web do |web_config| | |
| web_config.vm.box = base_box | |
| web_config.vm.forward_port("http", 80, 8080) | |
| web_config.vm.provision :chef_client do |chef| |
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
| # Knife Configuration File. | |
| # | |
| # This is a Ruby DSL to set configuration parameters for Knife's | |
| # general options. The default location for this file is | |
| # ~/.chef/knife.rb. If multiple Chef repositories are used, | |
| # per-repository configuration files can be created. A per repository | |
| # configuration file must be .chef/knife.rb in the base directory of | |
| # the Chef repository. For example, | |
| # | |
| # ~/Development/chef-repo/.chef/knife.rb |
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
| license: gpl-3.0 | |
| redirect: https://observablehq.com/@mbostock/best-candidate-circles |
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
| // based on http://emptysquare.net/blog/adding-an-include-tag-to-underscore-js-templates/ | |
| // include tag for underscore templates | |
| // <% include template-id %> | |
| var _underscore_template = _.template; | |
| _.template = function(str, data) { | |
| // match "<% include template-id %>" | |
| return _underscore_template( | |
| str.replace( | |
| /<%\s*include\s*(.*?)\s*%>/g, |
OlderNewer