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
require 'prawn' | |
Prawn.debug = true | |
Prawn::Document.generate("test.pdf", :page_layout => :landscape) do |pdf| | |
Header = Struct.new(:title, :width) | |
headers = [Header.new("Header\nOne", 50), | |
Header.new("Header\nTwo", 50), | |
Header.new("Header\nThree", 50)] | |
pdf.stroke_bounds |
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
# Apparently JRuby doesn't have a File#size (instance) method, | |
# but does have the equivalent class method | |
if !File.method_defined? :size | |
class File | |
def size | |
File.size(path) | |
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
module DataMapper::Model | |
def property_names | |
properties.map { |m| m.name.to_s } | |
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
#!/bin/bash | |
LEFT="DVI-1" | |
MIDDLE="DisplayPort-1" | |
RIGHT="DVI-0" | |
xrandr --output $LEFT --auto --rotate left --pos 0x0 | |
xrandr --output $MIDDLE --auto --right-of $LEFT | |
xrandr --output $RIGHT --auto --rotate left --right-of $MIDDLE |
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
Run options: | |
# Running tests: | |
............................/home/abe/.rvm/gems/[email protected]/gems/rubypython-0.5.3/lib/rubypython.rb:141: [BUG] Segmentation fault | |
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux] | |
-- Control frame information ----------------------------------------------- | |
c:0029 p:---- s:0123 b:0123 l:000122 d:000122 CFUNC :PyImport_ImportModule | |
c:0028 p:0064 s:0119 b:0119 l:000118 d:000118 METHOD /home/abe/.rvm/gems/[email protected]/gems/rubypython-0.5.3/lib/rubypython.rb:141 |
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
# app/models/wizard.rb | |
class Wizard | |
# shared instance methods go here | |
def self.all_visible_subwizards | |
descendants.entries.select{|d| d.visible?}.sort | |
end | |
end | |
# lib/wizard_fields.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
===================================================== | |
PROGRESS stack trace as of Fri Apr 27 20:56:38 2012 | |
===================================================== | |
Startup parameters: | |
-pf C:\Progress\OpenEdge\startup.pf,-cpinternal ISO8859-1,-cpstream ISO8859-1,-cpcoll Basic,-cpcase Basic,-d mdy,-numsep 44,-numdec 46,(end .pf),-param C:\Users\Abe\Desktop\abl-zmq\lib\zmq\test.p | |
Exception code: C0000005 ACCESS_VIOLATION | |
Fault address: 7358345E 51BAE0:76EBDFA5 | |
Registers: |
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 VAR mString AS MEMPTR NO-UNDO. | |
DEF VAR iCheckAddr AS INT NO-UNDO. | |
DEF VAR cSentence AS CHAR NO-UNDO INITIAL "The quick brown dog jumps over the lazy fox". | |
SET-SIZE(mString) = LENGTH(cSentence) + 1. /* Extra one is for \0 byte that gets put @ end */ | |
PUT-STRING(mString, 1) = cSentence. | |
RUN memchr(GET-POINTER-VALUE(mString) + 4, | |
ASC("b"), | |
LENGTH(cSentence) + 1, |
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/local/bin/perl | |
#!/usr/bin/env perl | |
#!/bin/sh | |
###################################################################### | |
# unichars - list characters for one or more properties | |
# | |
# Tom Christiansen <[email protected]> | |
# v1.0: Fri Oct 22 23:05:16 MDT 2010 | |
# v1.2: Tue Oct 26 08:28:25 MDT 2010 |
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
require 'java' | |
require 'itextpdf-5.2.0.jar' | |
require 'itext-xtra-5.2.0.jar' | |
java_import java.io.FileOutputStream | |
java_import com.itextpdf.text.pdf.PdfReader | |
java_import com.itextpdf.text.pdf.AcroFields | |
java_import com.itextpdf.text.pdf.XfaForm | |
java_import com.itextpdf.text.pdf.PdfStamper |