Skip to content

Instantly share code, notes, and snippets.

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"
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
@abevoelker
abevoelker / PS3.plist
Created May 27, 2012 14:37
HandBrake Xbox 360 / PS3 preset from version 0.93
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>AudioList</key>
<array>
<dict>
<key>AudioBitrate</key>
<string>160</string>
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
#!/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
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,
=====================================================
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:
@abevoelker
abevoelker / gist:2123152
Created March 19, 2012 18:32
concrete table inheritance
# 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
@abevoelker
abevoelker / error.txt
Created March 5, 2012 15:26
bundle exec ruby -I lib test/test_pygments.rb 2>&1 | tee error.txt
Run options:
# Running tests:
............................/home/abe/.rvm/gems/ruby-1.9.3-p0@pygments.rb/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/ruby-1.9.3-p0@pygments.rb/gems/rubypython-0.5.3/lib/rubypython.rb:141
@abevoelker
abevoelker / xrandr.sh
Created December 31, 2011 03:25
Triple head settings
#!/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