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
(use posix) | |
(define (make-serialport file) | |
(let ((fileno | |
(file-open | |
file | |
(bitwise-ior open/rdwr open/noctty open/nonblock)))) | |
; Enable blocking reads on the FD | |
(let ((current-fl (file-control fileno fcntl/getfl 0))) |
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
(use unix-sockets channel srfi-18 parley) | |
(define output-channel | |
(make-channel)) | |
(channel-enqueue output-channel (parley "Your name: ")) | |
(define-values (in out) | |
(unix-connect "sock")) |
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
(use tcp srfi-18 channel) | |
(define port 4321) | |
(print "connecting to " port) | |
(define (signal? msg) | |
(eq? (car msg) 'signal)) | |
(define procedures |
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
<?xml version="1.0"?> | |
<!-- <!DOCTYPE poem SYSTEM "dolor.dtd"> --> | |
<poem> | |
<title>Dolor</title> | |
<!-- Here's a simple example of an XML document --> | |
<author> | |
<last>Roethke</last> | |
<first>Theodore</first> |
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 < 3.0 | |
map.with_options :member => { :some_default_member_route => :get } do |default| | |
default.resources :frobs | |
default.resources :foos, :collection => { :some_special_collection => :get } | |
end | |
# Rails >= 3.0 | |
default_resource_routes = lambda do |
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 'rubygems' | |
require 'nokogiri' | |
module SXML | |
def self.transform(sxml, doc = Nokogiri::XML::Document.new) | |
el = Nokogiri::XML::Element.new(sxml[0].to_s, doc) | |
sxml[1..-1].each do |e| | |
case e |
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 rispp_box1(title, options = {}, &block) | |
SXML.transform([:div, { :class => 'box1' }, | |
[:div, { :class => 'wrap' }, | |
[:h2, { :class => options[:class] }], | |
capture { block.call(title, options) }]]) | |
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
remove Lock = Caps_Lock | |
remove Control = Control_L | |
keysym Caps_Lock = Control_L | |
add Lock = Caps_Lock | |
add Control = Control_L |
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 | |
cache=/tmp/proglist | |
if [ "$1" = "reset" -o ! -e "$cache" ]; then | |
ls -lL $(echo "$PATH" | sed 'y/:/ /') 2>/dev/null \ | |
| awk '$1 ~ /^[^d].*x/ { print $NF }' \ | |
| sort | uniq > $cache | |
fi |
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
puts "this is bar" |