Skip to content

Instantly share code, notes, and snippets.

View pallix's full-sized avatar
🌪️
ััััััe͠ngiﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠne̱̱͉͉͉͉͉͉͉͉͉͉͉͉͉͉͉͉͉͉͉͉͉e⃜ȑ̋̏̋̏̋̏̋̋̏̋̏̋̏̋̏̋̏

Pierre Allix pallix

🌪️
ััััััe͠ngiﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠﱠne̱̱͉͉͉͉͉͉͉͉͉͉͉͉͉͉͉͉͉͉͉͉͉e⃜ȑ̋̏̋̏̋̏̋̋̏̋̏̋̏̋̏̋̏
  • Berlin
View GitHub Profile
(ns flood.core)
(defn get-row
[matrix y]
(get matrix (- (dec (count matrix)) y)))
(defn assoc-xy
[matrix x y v]
(assoc-in matrix [(- (dec (count matrix)) y) x] v))
@pallix
pallix / gist:5567467
Last active December 17, 2015 06:39
Example of using the Clojure Lacij library to display the content of an XML file
(ns lacij.examples.display-xml
(:use lacij.edit.graph
lacij.view.graphview
lacij.layouts.layout
clojure.pprint)
(:require [clojure.xml :as xml]))
(defn node-text
[xml]
(if (string? xml)
(def to-merge
{:sct_agree "Agree"
:sct_argument "Argument"
:sct_ask_agree "Do you agree with the claim?"
:sct_change "Change"
:sct_choose_issue "Choose an issue from the list below, to participate in the consultation on that issue."
:sct_claim "Claim"
:sct_compare "Compare"
:sct_comparison "Comparison"
lein cljsbuild auto dev
Compiling ClojureScript.
Compiling "resources/policymodellingtool/public/js/compiled-app.js" from "src-cljs"...
WARNING: Use of undeclared Var jayq.core/coll at line 58 file:/home/pal/.m2/repository/jayq/jayq/0.1.0-
alpha3/jayq-0.1.0-alpha3.jar!/jayq/core.cljs
WARNING: Use of undeclared Var jayq.core/coll at line 60 file:/home/pal/.m2/repository/jayq/jayq/0.1.0-
alpha3/jayq-0.1.0-alpha3.jar!/jayq/core.cljs
WARNING: Use of undeclared Var jayq.core/i at line 60 file:/home/pal/.m2/repository/jayq/jayq/0.1.0-alp
ha3/jayq-0.1.0-alpha3.jar!/jayq/core.cljs
WARNING: Use of undeclared Var jayq.core/coll at line 58 .lein-cljsbuild-compiler-0/jayq/core.cljs
(ns carneades.web.views
(:use [hiccup core page-helpers form-helpers]))
(defn include-all-js []
(html
(map include-js ["/js/jquery-1.6.2.js"
"/js/jquery-ui-1.8.14.custom.min.js"
"/js/jquery.svg.js"
"/js/jquery.svgdom.js"
"/js/jquery.svganim.js"
(ns carneades.web.routes
(:use compojure.core
carneades.web.views
carneades.web.controller
[hiccup.middleware :only (wrap-base-url)]
ring.adapter.jetty
ring.middleware.session)
(:require [compojure.route :as route]
[compojure.handler :as handler]
[compojure.response :as response]
@pallix
pallix / ns
Created April 20, 2011 14:17
Emacs YASnippet snippet for Clojure ns declarations
(ns `(let* ((nsname '())
(dirs (split-string (buffer-file-name) "/"))
(aftersrc nil))
(dolist (dir dirs)
(if aftersrc
(progn
(setq nsname (cons dir nsname))
(setq nsname (cons "." nsname)))
(when (or (string= dir "src") (string= dir "test"))
(setq aftersrc t))))
@pallix
pallix / circle svg
Created March 24, 2011 15:35
circle file causing an exception in analemma
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"