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
<?php | |
error_reporting(E_NONE); | |
require_once("SetaPDF_Stamper.php"); | |
define('SetaPDF_STAMPER_FONTPATH', 'font/'); | |
// Create a new instance of SetaPDF_Stamper with output method "Inline" | |
$stamper =& SetaPDF_Stamper::factory('I'); | |
$fileio = array( | |
"in" => "/Users/josh/Desktop/week6.pdf", | |
"out" => "/Users/josh/Desktop/week6-marked.pdf", |
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
pdf = Prawn::Document.new(:template => @format.zip.path) | |
inspector = PDF::Inspector::Page.analyze(pdf.render) | |
pdf.font 'Helvetica' | |
pdf.font_size = 8 | |
1.upto(inspector.pages.size) do |page| | |
pdf.go_to_page(page) | |
pdf.transparent(0.2) do | |
pdf.fill_color "ff0000" | |
pdf.draw_text "watermark", :at => [200,420], :size => 32, :rotate => 45 | |
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
module Cmt | |
CONFIG = { | |
# Allow GCX logins in the form on the CMT login page. | |
:gcx_direct_logins => true, | |
# Allow local user logins in the form on the CMT login page. | |
:local_direct_logins => true, | |
# Allow GCX logins using the GCX login page (aka the greenscreen). | |
# This will show a link on the login page. If the direct GCX or |
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
def download_pdf | |
@pdf = Prawn::Document.new(:template => @format.zip.path) | |
inspector = PDF::Inspector::Page.analyze(@pdf.render) | |
@pdf.font 'Helvetica' | |
@pdf.font_size = 8 | |
1.upto(inspector.pages.size) do |page| | |
@pdf.go_to_page(page) | |
@pdf.move_down 750 | |
@pdf.text "Prepared for #{current_user.name}" | |
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
var i = 0; | |
foreach (var dimType in ViewData.Model.SelectedProduct.DimensionTypes) | |
{ | |
i++; | |
string ddlName = String.Format("ddlDimension_{0}", dimType.Key); | |
var dimensions = variations.Select(sv => sv.Dimensions.FirstOrDefault(d => d.TypeKey == dimType.Key)); | |
var valueList = dimensions | |
.Select(d => new { Key = d.Key, ShortValue = d.ShortValue, IsInStock = variations.Any(sv => sv.Available && sv.Dimensions.Any(sd => sd.Key == d.Key)) }) | |
.Distinct() |
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
foreach (var dimType in ViewData.Model.SelectedProduct.DimensionTypes) | |
{ | |
string ddlName = String.Format("ddlDimension_{0}", dimType.Key); | |
var dimensions = variations.Select(sv => sv.Dimensions.FirstOrDefault(d => d.TypeKey == dimType.Key)); | |
var valueList = dimensions | |
.Select(d => new { Key = d.Key, ShortValue = d.ShortValue, IsInStock = variations.Any(sv => sv.Available && sv.Dimensions.Any(sd => sd.Key == d.Key)) }) | |
.Distinct() | |
.OrderBy(d => DimensionSorter.GetSortOrder(d.Key)) | |
.ToList(); |
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) | |
ActionController::RoutingError in 'PostsController with a guest does not allow a post to be disabled' | |
No route matches {:controller=>"posts", :topic_id=>123, :id=>567, :action=>"deactivate"} | |
./spec/controllers/posts_controller_spec.rb:146: | |
2) | |
ActionController::RoutingError in 'PostsController with an admin user disables a post' | |
No route matches {:controller=>"posts", :topic_id=>123, :id=>567, :action=>"deactivate"} | |
./spec/controllers/posts_controller_spec.rb:123: |
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
TypeError in People#index | |
Showing /Users/josh/htdocs/test2/app/views/layouts/people.html.erb where line #1 raised: | |
can't dup Symbol | |
Extracted source (around line #1): | |
1: <% inside_layout 'application' do -%> | |
2: inside |
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
rails test_app | |
cd test_app | |
rails g scaffold person | |
rails plugin install git://github.com/radar/nested-layouts.git | |
# application.html.erb | |
<!DOCTYPE html> | |
<html> | |
<head> |
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
LocalJumpError in Manage#index | |
Showing /Users/josh/htdocs/mt/app/views/layouts/application.html.erb where line #71 raised: | |
no block given | |
Extracted source (around line #71): | |
68: <div class="flash warning" id="flash_warning"><%= flash[:warning].html_safe %></div> | |
69: <% end %> |