This file contains 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
/** | |
* @private | |
* @method _render | |
*/ | |
_render: function(ctx) { | |
var current, // current instruction | |
previous = null, | |
x = 0, // current x | |
y = 0, // current y | |
controlX = 0, // current control point x |
This file contains 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 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
# Public: Template to render views outside the context of a controller. | |
# | |
# Useful for rendering Rails 2.3.x views in rake tasks or background jobs when a | |
# controller is unavailable. | |
# | |
# Examples | |
# | |
# template = OfflineTemplate.new(:users) | |
# template.render("users/index", :layout => false, :locals => { :users => users }) | |
# |
This file contains 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 rvmrc file | |
create_file ".rvmrc", "rvm 1.9.2" | |
gem "simple_form" | |
gem "devise" | |
gem "rake", "0.9.1" | |
run 'bundle install' | |
rake "db:create", :env => 'development' |
This file contains 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
require 'net/ssh' | |
module Backup | |
module Database | |
class SshBackup < Base | |
attr_accessor :name | |
attr_accessor :host | |
attr_accessor :username | |
attr_accessor :password | |
attr_accessor :host_username |
This file contains 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
# Define in app controller | |
class ApplicationController < ActionController::Base | |
before_filter :require_login | |
# redirect somewhere that will eventually return back to here | |
def redirect_away(*params) | |
session[:original_uri] = request.request_uri | |
redirect_to(*params) | |
end |
This file contains 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
<VirtualHost *:80> | |
ServerName blah.localhost | |
ServerAlias *.blah.localhost | |
DocumentRoot /var/www/blah/current/public | |
</VirtualHost> |
This file contains 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
# Generated by NetworkManager | |
nameserver 127.0.0.1 # <--- ADD THIS | |
nameserver 8.8.4.4 | |
nameserver 8.8.8.8 |
This file contains 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 domains which you want to force to an IP address here. | |
# The example below send any host in doubleclick.net to a local | |
# webserver. | |
address=/blah.localhost/127.0.0.1 | |
# Or which to listen on by address (remember to include 127.0.0.1 if | |
# you use this.) | |
listen-address=127.0.0.1 |