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
data = {:name => 'Bob', :gender => 'm', :relation => 'Uncle' } | |
pdfs = capture_pdfs do | |
pdf :basic_info do | |
text 'name', data[:name] | |
radio_group 'sex' do | |
fill 'male', :when => data[:gender] == 'm' | |
fill 'female', :when => data[:gender] == 'f' | |
end | |
checkbox_group 'relation' do |
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
class Hash | |
def hflatten(path=[]) | |
self.inject({}) do |a,(k,v)| | |
if v.is_a? Hash | |
# Recurse | |
a.merge(v.hflatten(path.dup << k)) | |
else | |
# Base case | |
a[(path.dup << k).join('.')] = v; a | |
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
require 'sinatra' | |
require './models' | |
get '/customers' do | |
Customer.all.to_json | |
end | |
get '/customer/:cust_num' do |cust_num| | |
@customer = Customer.get(cust_num) | |
if @customer |
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
source :rubygems | |
gem "jdbc-openedge", "11.1" | |
gem "dm-openedge-adapter", :git => "git://github.com/abevoelker/dm-openedge-adapter.git" | |
gem "data_mapper", "~> 1.2.0" |
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 'state_machine' | |
class LightSwitch | |
attr_accessor :dark_outside | |
alias :dark_outside? :dark_outside | |
state_machine :state, :initial => :_off_ do | |
event :turn_on do | |
transition :_off_ => :_on_, :if => lambda {|ls| ls.dark_outside? } | |
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
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 |
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
#!/usr/local/bin/perl | |
#!/usr/bin/env perl | |
#!/bin/sh | |
###################################################################### | |
# unichars - list characters for one or more properties | |
# | |
# Tom Christiansen <tchrist@perl.com> | |
# v1.0: Fri Oct 22 23:05:16 MDT 2010 | |
# v1.2: Tue Oct 26 08:28:25 MDT 2010 |
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
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 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 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 |