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
- latest.each do |article| | |
= render( 'article_embedded', :item => article, :extended => true ) { article.compiled_content( :snapshot => :pre ) } | |
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 fj | |
(:import [java.util.concurrent RecursiveTask | |
ForkJoinPool])) | |
(set! *warn-on-reflection* true) | |
;; ----------------------------------------------- | |
;; Helpers to provide an idiomatic interface to FJ | |
(defprotocol IFJTask |
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
(deftype Foo [something] | |
ISomeInterface | |
([self other-Foo] | |
; How do I get other-Foo's something object here? | |
)) |
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
# A list is either () or (head, list). | |
# list = () | (head, list) | |
def make_list(xs): return (xs[0], make_list(xs[1:])) if xs else () | |
L = make_list('abcd') | |
## L | |
#. ('a', ('b', ('c', ('d', ())))) | |
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
- author = @item[:author] || "Leo Franchi" | |
#article | |
#article-header | |
%h1#title | |
%a{href:permalink_for_article(@item)} | |
= @item[:title] | |
#date | |
%time{datetime:@item[:created_at].strftime("%Y-%m-%d"), pubdate:"pubdate"} | |
= @item[:created_at].strftime("%A, %B %d %Y") | |
#article-body |
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 zipper | |
[] | |
[() ()]) | |
(defn insert-at-cursor | |
[zipper newchar] | |
[(cons newchar (first zipper)) (second zipper)]) | |
(defn get-at-cursor | |
[zipper] |
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 item<? | |
[{patha :path} {pathb :path}] | |
(loop [patha patha | |
pathb pathb] | |
(let [{l :branch l-disamb :disamb} (first patha) | |
{r :branch r-disamb :disamb} (first pathb)] | |
(cond | |
(nil? l) (= r 1) | |
(nil? r) (= l 0) | |
(= l r) (if (and (= 1 (count patha)) (= 1 (count pathb))) |
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/src/utils/debug.cpp b/src/utils/debug.cpp | |
index 6fac78f..adefeee 100644 | |
--- a/src/utils/debug.cpp | |
+++ b/src/utils/debug.cpp | |
@@ -173,7 +173,7 @@ Block::Block( const char *label ) | |
: m_label( label ) | |
, m_color( s_colorIndex ) | |
{ | |
- if( !debugEnabled() ) | |
+ if( !debugEnabled() || DEBUG_INFO < s_debugLevel) |
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
>>> from contextlib import contextmanager | |
>>> @contextmanager | |
... def foobar(baz): | |
... print "Before" | |
... yield | |
... print "After" | |
... | |
>>> with foobar(0): | |
... print "Doing stuff" | |
... raise Exception |
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
(use 'gloss.io 'gloss.core) | |
;; Support | |
(def flags {:RAW 1 | |
:JSON 2 | |
:FRAGMENT 4 | |
:COMPRESSED 8 | |
:DBOP 16 | |
:PING 32 |