Skip to content

Instantly share code, notes, and snippets.

@duelinmarkers
duelinmarkers / error_not_reset.rb
Last active May 3, 2018 16:14
Ruby doesn't reset rescued error var on retry
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
@duelinmarkers
duelinmarkers / gem_make.out
Created December 18, 2017 22:32
Build failure: grpc-1.8.0 --platform ruby
/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 -
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)",
@duelinmarkers
duelinmarkers / preso-stuff.el
Created September 6, 2015 15:19
Presentation-related excerpt of my emacs setup.
(add-to-list 'load-path "~/Projects/preso/org-present")
(autoload 'org-present "org-present" nil t)
(eval-after-load "org-present"
'(progn
(add-hook 'org-present-mode-hook
(lambda ()
(org-present-big)
(org-display-inline-images)
(toggle-frame-fullscreen)
@duelinmarkers
duelinmarkers / gist:a027446d56ee8dcb6c0d
Last active August 29, 2015 14:03
Idris install via cabal fails
$ cabal install idris
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: idris-0.9.13.1 (user goal)
trying: optparse-applicative-0.9.0 (dependency of idris-0.9.13.1)
trying: transformers-compat-0.3.3.4 (dependency of optparse-applicative-0.9.0)
trying: transformers-compat-0.3.3.4:-three
trying: trifecta-1.4.2 (dependency of idris-0.9.13.1)
next goal: transformers (dependency of idris-0.9.13.1)
rejecting: transformers-0.2.2.0/installed-367... (conflict:
@duelinmarkers
duelinmarkers / sessions.clj
Created May 9, 2014 22:00
Surprising behavior w/ Clojure vs Java data structures
user=> (-> {} (assoc [1 2] "vec") (assoc (java.util.ArrayList. [1 2]) "alist"))
{[1 2] "alist"}
user=> (-> #{} (conj [1 2]) (conj (java.util.ArrayList. [1 2])))
#{[1 2]}
user=> *clojure-version*
{:major 1, :minor 5, :incremental 1, :qualifier nil}
;;;;;;;;;;;;;;;;;;;;;
user> (-> {} (assoc [1 2] "vec") (assoc (java.util.ArrayList. [1 2]) "alist"))

Keybase proof

I hereby claim:

  • I am duelinmarkers on github.
  • I am duelinmarkers (https://keybase.io/duelinmarkers) on keybase.
  • I have a public key whose fingerprint is D0C8 9C93 956C 3726 B402 5ED3 7C52 19A2 B058 E31C

To claim this, I am signing this object:

@duelinmarkers
duelinmarkers / init.el
Created August 13, 2013 03:28
A paredit-based attempt at local rename for Clojure in emacs. M-x parfactor-rename-local.
(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)
module RapidFTR
module AddOns
def self.add_exporter(e)
exporters << e
end
def self.exporters
@exporters ||= []
end
@duelinmarkers
duelinmarkers / defmodel_macro.clj
Created November 27, 2012 19:46
"Why not to use my library clj-record" code examples
(defmodel widget db
(associations
(:has-many :sizes))
(validation
(:name "Name is required" #(not (empty? %)))))