Skip to content

Instantly share code, notes, and snippets.

View ayato-p's full-sized avatar
💪

ayato-p ayato-p

💪
  • UZABASE, inc.
  • Tokyo, Japan
  • 14:21 (UTC +09:00)
View GitHub Profile
;; -*- 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'
@ayato-p
ayato-p / liar.clj
Created February 7, 2017 00:00
嘘吐き!
(ns liar)
(defn with-liar* [exp]
(map (fn [sym]
(case sym
true 'false
false 'true
sym))
exp))
(def a (agent 100
:validator #(not= % 1)
:error-handler println))
(defmulti collatz even?)
(defmethod collatz true
[x]
(println x)
(/ x 2))
@ayato-p
ayato-p / core.clj
Last active December 12, 2016 10:53
`lein new demo` で作って下のコードを貼り付けるだけ。
(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"))
(ns example.another)
(defn hello [] (println "Hello"))
(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}]))
;; 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
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>()
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){
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));