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
import { h, Component } from 'preact'; | |
import { Router, Link } from 'preact-router'; | |
function Header({url}) { | |
const NavItem = ({href, children}, state) => ( | |
<li className={href==url ? 'is-active' : ''}><Link href={href}>{children}</Link></li> | |
) | |
return ( | |
<section class="hero is-primary"> | |
<div class="hero-foot"> |
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
(let [ws '(進捗 どう です か) | |
wc (count ws) | |
l (loop [r [] i 0] | |
(let [n (rand-int wc) | |
s (nth ws n) | |
r (conj r s)] | |
(if (= n i (dec wc)) | |
r | |
(recur r (if (= n i) (inc i) 0))))) | |
s (apply str l)] |
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
(->> | |
(let [[h & t] (range 1 10)] | |
(reduce | |
(fn [l h] | |
(mapcat (fn [[a b s]] | |
[[(conj a b) h (str s " + " h)] | |
[(conj a b) (- h) (str s " - " h)] | |
[a (bigint (str b h)) (str s h)]]) | |
l)) | |
[[[] h h]] |
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
;; Copyright (c) Rich Hickey and contributors. All rights reserved. | |
;; The use and distribution terms for this software are covered by the | |
;; Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) | |
;; which can be found in the file epl-v10.html at the root of this distribution. | |
;; By using this software in any fashion, you are agreeing to be bound by | |
;; the terms of this license. | |
;; You must not remove this notice, or any other, from this software. | |
ns clojure.core.async | |
(:refer-clojure :exclude [reduce into merge map take partition |
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
# boot foo.boot usage sleep -t 10 | |
(set-env! | |
:dependencies '[[org.clojure/core.async "0.1.346.0-17112a-alpha"] | |
[org.clojure/tools.logging "0.3.1"] | |
[org.slf4j/slf4j-simple "1.7.10"]]) | |
(doseq [s '(info warn)] (ns-unmap *ns* s)) | |
(require '[clojure.core.async :as async | |
:refer (go go-loop chan <! >! <!! >!! timeout thread)] | |
'[clojure.tools.logging :refer (debug info warn error spy)]) |
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
Caused by: com.lyncode.jtwig.exception.RenderException: com.lyncode.jtwig.exception.CalculateException: com.lyncode.jtwig.resource.WebJtwigResource@31e1a5eb -> Line 7, column 37: Unable to find function with name 'trans' | |
at com.lyncode.jtwig.content.model.compilable.Output$Compiled.render(Output.java:56) | |
at com.lyncode.jtwig..model.compilable.Sequence$Compiled.render(Sequence.java:80) | |
at com.lyncode.jtwig.parser.JtwigParser$CompiledDocument.render(JtwigParser.java:67) | |
at com.lyncode.jtwig.parser.JtwigParser$CompiledDocument.render(JtwigParser.java:67) | |
at com.lyncode.jtwig.mvc.JtwigView.renderMergedTemplateModel(JtwigView.java:103) | |
at org.springframework.web.servlet.view.AbstractTemplateView.renderMergedOutputModel(AbstractTemplateView.java:167) | |
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303) | |
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1228) | |
at org.springframework.we |
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
#!/usr/bin/env lein exec | |
(use '[leiningen.exec :only (deps)]) | |
(deps '[[clj-http "0.7.1"]]) | |
(require '[clj-http.client :as client]) | |
(defn api-request [url] | |
(:body (client/get url {:as :json}))) | |
(let [user (api-request "http://ugomemo.hatena.ne.jp/[email protected]") | |
movies (api-request "http://ugomemo.hatena.ne.jp/11F9E990AA34FFBC@DSi/movies.json")] |
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
public class A { | |
public static void main(String[] args) { | |
while (true) { | |
new Thread(new Runnable() { | |
public void run() { | |
try { | |
Thread.sleep(10000L); | |
} catch (InterruptedException e) { | |
} | |
} |
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 { color: #669; text-decoration: none; } | |
a:hover { text-decoration: underline; } | |
h1 { font: 36px; } | |
#page { padding: 5px; width: 960px; margin: 20px auto; } | |
#header { height: 180px; } | |
#content { width: 630px; float: left; } | |
#sidebar { width: 300px; float: right; } | |
#footer { clear: both; } | |
/* for 980px or less */ | |
@media screen and (max-width: 980px) { |
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
package rythm.test; | |
import static org.hamcrest.Matchers.*; | |
import static org.junit.Assert.*; | |
import java.io.File; | |
import java.util.Properties; | |
import org.junit.Test; |
NewerOlder