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 RSpec::Matchers | |
| define :be_a_visitable_link_from do |page| | |
| match do |page_link| | |
| begin | |
| page.visit(page_link[:href]) | |
| rescue Exception => e | |
| @e = e | |
| end | |
| if @e || [500,404].include?(page.status_code) |
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 changes_scope(changes_before_num) | |
| return @injected_versions_scope if @injected_versions_scope | |
| if changes_before_num | |
| Version.where('id > ?',changes_before_num).where(:item_type => 'UploadAttempt').order('id DESC') | |
| else | |
| Version.where(:item_type => 'UploadAttempt').order('id DESC') | |
| 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 | |
| #xrdb -merge .Xresources | |
| trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --width 15 --height 12 --transparent true --tint 0x000000 & | |
| gnome-screensaver & |
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
| (ns predict-train-delays.twitter | |
| (:use | |
| [twitter.oauth] | |
| [twitter.callbacks] | |
| [twitter.callbacks.handlers] | |
| [twitter.api.restful]) | |
| (:import | |
| (twitter.callbacks.protocols SyncSingleCallback))) | |
| (def my-creds (make-oauth-creds "nkjAm6lD6tpMwE6UeFw" |
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
| class Memoizer | |
| def initialize(tgt) | |
| @target = tgt | |
| @cache = {} | |
| end | |
| def cache(*method_names) | |
| method_names.each {|name| cache[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
| class ComposedCache | |
| def initialize(target) | |
| @target = target | |
| end | |
| def cache(*method_names) | |
| method_names.each do |m| | |
| original = @target.method(m) | |
| results = {} |
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
| (ns going-native.core | |
| (:import (com.sun.jna "Native")) | |
| (:gen-class)) | |
| (gen-interface | |
| :name jna.CLibrary | |
| :extends [com.sun.jna.Library] | |
| :methods [[printf [String] Integer]]) | |
| (def glibc (Native/loadLibrary "c" jna.CLibrary)) |
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
| (defproject going-native "0.1.0-SNAPSHOT" | |
| :description "FIXME: write description" | |
| :url "http://example.com/FIXME" | |
| :license {:name "Eclipse Public License" | |
| :url "http://www.eclipse.org/legal/epl-v10.html"} | |
| :jvm-opts ["-Djava.library.path=/usr/share/java"] | |
| :main going-native.core | |
| :dependencies [[org.clojure/clojure "1.5.1"] | |
| [net.java.dev.jna/jna "3.3.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
| module DataSource | |
| module ConnectionProxies | |
| class TeradataConnectionProxy < ConnectionProxy | |
| def initialize(connection) | |
| super(connection) | |
| connection.class_eval do | |
| @connection.class_eval do | |
| def columns(*args) | |
| binding.pry |
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/bin/expect | |
| spawn python3.2 [lindex $argv 0] | |
| expect "mail" | |
| send [email protected]\r | |
| expect "assword" | |
| send ASSSSSSSSS\r | |
| interact |