This file contains hidden or 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
;; -*- mode: emacs-lisp; lexical-binding: t -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Layer configuration: | |
This function should only modify configuration layer settings." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory | |
;; `+distribution'. For now available distributions are `spacemacs-base' |
This file contains hidden or 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 liar) | |
(defn with-liar* [exp] | |
(map (fn [sym] | |
(case sym | |
true 'false | |
false 'true | |
sym)) | |
exp)) |
This file contains hidden or 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
(def a (agent 100 | |
:validator #(not= % 1) | |
:error-handler println)) | |
(defmulti collatz even?) | |
(defmethod collatz true | |
[x] | |
(println x) | |
(/ x 2)) |
This file contains hidden or 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 demo.core | |
(:require [compojure.core :as c :refer [defroutes GET POST]] | |
[hiccup.core :as h] | |
[hiccup.form :as hf] | |
[ring.adapter.jetty :as server] | |
[ring.util.response :as res])) | |
(defn html-response [res] | |
(res/content-type res "text/html;charset=utf-8")) |
This file contains hidden or 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.another) | |
(defn hello [] (println "Hello")) | |
This file contains hidden or 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 twilog-scraper.core | |
(:require [net.cgrand.enlive-html :as html] | |
[skyscraper :as s]) | |
(:gen-class)) | |
(defn seed [username] | |
(let [url (str "http://twilog.org/" username "/archives")] | |
[{:username username | |
:url url | |
:processor :archives-page}])) |
This file contains hidden or 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 | |
(require 'package) | |
(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/")) | |
(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/")) | |
(package-initialize) | |
(require 'cl) | |
(defvar installing-package-list | |
'( | |
anything |
This file contains hidden or 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
fun Int.isZero() = this == 0 | |
fun Int.lt(other: Int) = this < other | |
fun Int.lte(other: Int) = this <= other | |
fun Int.gt(other: Int) = this > other | |
fun Int.gte(other: Int) = this >= other | |
class KotlinF_ck { | |
private var tokens = charArray() | |
private var jumps = hashMapOf<Int, Int>() |
This file contains hidden or 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
fun <T> Array<T>.component1() = this.get(0) | |
fun <T> Array<T>.component2() = this.get(1) | |
class HQ9Plus(private val src: String) { | |
private var count = 0 | |
fun eval() { | |
src.forEach { | |
when(it){ |
This file contains hidden or 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 java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.Comparator; | |
import java.util.List; | |
public class Main { | |
public static void main(String[] args) { | |
List<Employee> employees = new ArrayList<>(); | |
employees.add(new Employee("hoge", 3)); | |
employees.add(new Employee("fuga", 1)); |
NewerOlder