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
failures = 0 | |
begin | |
raise "failed with failures: #{failures}" if failures < 3 | |
puts "did not fail" | |
rescue => e | |
puts "rescued #{e}" | |
failures += 1 | |
retry if failures < 5 | |
raise "re-raising" | |
ensure |
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
/home/pair/.rvm/rubies/ruby-2.2.3/bin/ruby -r ./siteconf20171218-28931-gwasiz.rb extconf.rb | |
Building internal gRPC into /home/pair/.rvm/gems/ruby-2.2.3@gateway/gems/grpc-1.8.0/src/ruby/ext/grpc/libs/opt | |
make: Entering directory `/home/pair/.rvm/gems/ruby-2.2.3@gateway/gems/grpc-1.8.0' | |
make: Circular /home/pair/.rvm/gems/ruby-2.2.3@gateway/gems/grpc-1.8.0/src/ruby/ext/grpc/libs/opt/libares.a <- /home/pair/.rvm/gems/ruby-2.2.3@gateway/gems/grpc-1.8.0/src/ruby/ext/grpc/libs/opt/libz.a dependency dropped. | |
[C] Compiling third_party/cares/cares/ares__close_sockets.c | |
mkdir -p `dirname /home/pair/.rvm/gems/ruby-2.2.3@gateway/gems/grpc-1.8.0/src/ruby/ext/grpc/objs/opt/third_party/cares/cares/ares__close_sockets.o` | |
gcc -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googlemock/include -Ithird_party/boringssl/include -Ithird_party/cares -Ithird_party/cares/cares -DGPR_BACKWARDS_COMPATIBILITY_MODE -g -Wall -Wextra -Werror -Wno-long-long -Wno-unused-parameter -DOSATOMIC_USE_INLINED=1 -O2 -fPIC - |
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
diff --git a/Cargo.lock b/Cargo.lock | |
index a2e127d..d593db6 100644 | |
--- a/Cargo.lock | |
+++ b/Cargo.lock | |
@@ -2,119 +2,191 @@ | |
name = "cargo-release" | |
version = "0.6.1-pre" | |
dependencies = [ | |
- "clap 2.2.5 (registry+git://crates.mirrors.ustc.edu.cn/index)", | |
- "quick-error 0.1.4 (registry+git://crates.mirrors.ustc.edu.cn/index)", |
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
(defun parfactor-rename-local (new-name) | |
(interactive "Mnew-name: ") | |
(save-excursion | |
(if (not (region-active-p)) | |
(er/mark-clj-word)) | |
(let* ((old-name (buffer-substring-no-properties (region-beginning) (region-end))) | |
(start-of-declaring-sexp (find-start-of-form-declaring old-name))) | |
(message "Renaming %s to %s" old-name new-name) | |
(goto-char start-of-declaring-sexp) | |
(while (re-search-forward old-name (scan-sexps start-of-declaring-sexp 1) t) |
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
module RapidFTR | |
module AddOns | |
def self.add_exporter(e) | |
exporters << e | |
end | |
def self.exporters | |
@exporters ||= [] | |
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
(defmodel widget db | |
(associations | |
(:has-many :sizes)) | |
(validation | |
(:name "Name is required" #(not (empty? %))))) |
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
(defn get-fb-access-token [code redirect-uri] | |
(run-pipeline (access-token-url code redirect-uri) | |
{:error-handler (fn [_])} | |
#(http-request {:url %}) | |
read-access-token-from-response)) | |
(defn get-fb-user-with-token [access-token] | |
(run-pipeline access-token | |
{:error-handler (fn [_])} | |
fb-user-url |
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
(ring.adapter.jetty/run-jetty | |
(ring.middleware.params/wrap-params | |
(ring.middleware.multipart-params/wrap-multipart-params | |
(fn [request] | |
(if (= :get (:request-method request)) | |
(render-html-form-with-file-field-called "my-file") | |
(let [file (get-in req [:params "my-file" :tempfile])] | |
; file is a java.io.File | |
(with-open [reader (clojure.java.io/reader file)] | |
; reader is a--You guessed it!--java.io.Reader |
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 example.first) |
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
# in lib/tasks | |
namespace :couchdb do | |
task :migrate => :environment do | |
migration_files = Dir[Rails.root.join('db/migrate/*.rb')] | |
migration_files_by_id = Hash[*migration_files.map {|path| [migration_number_from_file(path), path] }.flatten] | |
applied_migration_ids = SchemaMigration.all.map(&:id) | |
migration_ids_to_apply = migration_files_by_id.except(*applied_migration_ids).sort | |
if migration_ids_to_apply.empty? | |
puts "DB already up to date." | |
else |
NewerOlder