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
; CIDER 0.6.0alpha (package: 20140316.1007) (Clojure 1.5.1, nREPL 0.2.3) | |
user> (.maxMemory (Runtime/getRuntime)) | |
103284736 | |
user> (require '[clojure.java.io :as io]) | |
nil | |
user> (with-open [f (io/writer "/tmp/foo")] (doseq [x (range 50000)] (.write f (prn-str [x (range 1000)])))) | |
nil | |
user> (.length (io/file "/tmp/foo")) | |
194988890 | |
user> (slurp "/tmp/foo") |
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 'compile) | |
(defun locate-all-dominating-files (dir filename) | |
"Searches for FILENAME in DIR and its parents, returning a list | |
of all dirs containing the file." | |
(let ((found-dir (locate-dominating-file (expand-file-name dir) filename))) | |
(if found-dir | |
(cons found-dir (locate-all-dominating-files | |
(concat found-dir "..") | |
filename))))) |
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
(ns my.cache.listener | |
(:require [immutant.cache :as c]) | |
(:import org.infinispan.notifications.Listener | |
[org.infinispan.notifications.cachelistener.annotation | |
CacheEntryCreated CacheEntryModified CacheEntryRemoved])) | |
(definterface Handler (^void handle [event])) | |
(deftype ^{Listener true} | |
Monitor [] |
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
#!/bin/bash | |
IN="LVDS1" | |
EXT="HDMI3" | |
if (xrandr | grep "$EXT disconnected"); then | |
xrandr -d :0.0 --output $IN --auto --output $EXT --off | |
else | |
xrandr -d :0.0 --output $IN --auto --output $EXT --auto --right-of $IN --primary | |
fi |
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
; CIDER 0.6.0alpha (package: 0.5.0) (Clojure 1.6.0, nREPL 0.2.3) | |
=> (schedule #(println "foo")) | |
=> (schedule #(println "foo")) | |
=> (schedule #(println "foo")) | |
... | |
=> (def s (immutant.scheduling.internal/scheduler {})) | |
#<Var@5f67764a: | |
#<QuartzScheduling org.projectodd.wunderboss.scheduling.QuartzScheduling@450109d4>> | |
; scheduled job names (and thus their JobKeys) are retained, even if they're not repeating |
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
Spec::Runner.configure do |config| | |
config.before(:suite) do | |
configuration = org.jboss.arquillian.impl.XmlConfigurationBuilder.new.build() | |
Thread.current[:test_runner_adaptor] = org.jboss.arquillian.impl.DeployableTestBuilder.build(configuration) | |
Thread.current[:test_runner_adaptor].beforeSuite | |
end | |
config.before(:all) do | |
if (self.class.respond_to? :create_deployment) |
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
Dear Mr. Benton, | |
It has been brought to our attention that our social studies | |
class, Ze Fat Cats, has been treated differently than the other | |
classes in the case of the ropes course. This message is written | |
not in an act of asking to go out, but why we don't and if we | |
will. Therefore, we hope you take us seriously and consider our | |
thoughts. | |
We happen to know that both the Lactopuses (Lactopi?) and the |
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 'spec_helper' | |
require 'open-uri' | |
# A remote group nested within a local one | |
describe "end-to-end testing" do | |
# Deploy our apps | |
deploy <<-END.gsub(/^ {4}/,'') | |
application: | |
root: #{File.dirname(__FILE__)}/.. |
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 "#{File.dirname(__FILE__)}/../../twitter/spec/spec_helper" | |
require 'torquebox-core' | |
remote_describe "tweet consumption testing" do | |
# Necessary for injection in examples | |
include TorqueBox::Injectors | |
# Deploy our apps | |
deploy <<-END.gsub(/^ {4}/,'') |
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 'torquespec' | |
TorqueSpec.local { | |
require 'capybara/dsl' | |
require 'akephalos' | |
Capybara.register_driver :akephalos do |app| | |
Capybara::Driver::Akephalos.new(app, :browser => :firefox_3) | |
end |
OlderNewer