Skip to content

Instantly share code, notes, and snippets.

View abcdw's full-sized avatar
🏛️
building

Andrew Tropin abcdw

🏛️
building
View GitHub Profile
@abcdw
abcdw / .vimrc
Last active June 17, 2022 11:32
micro vimrc
"""""""""""""""""""""""
" MY MICRO VIMRC v0.2 "
"""""""""""""""""""""""
set nocompatible
set wildmenu
set wildmode=longest:full,full
set keywordprg=:help
set ruler
@abcdw
abcdw / msort.clj
Last active June 16, 2022 01:02
merge sort in clojure
(defn mrg
([L R] (mrg L R []))
([[l & left :as L] [r & right :as R] M]
(if (or (empty? L) (empty? R))
(concat M L R)
(if (<= l r)
(recur left R (conj M l))
(recur L right (conj M r))))))
(defn msort [arr]
@abcdw
abcdw / example.clj
Last active September 26, 2016 13:33
;; clojure google maps api example
(def api-url "http://maps.googleapis.com/maps/api/geocode/json?sensor=false&latlng=")
(def places
[{:descr "Place in Champniers"
:lat 45.700160
:lng 0.189237}
{:descr "Place in Innopolis"
:lat 55.752803
:lng 48.743634}
{:descr "Place in Vvedenskaya Sloboda"
@abcdw
abcdw / gitstory.org
Created March 21, 2018 09:35
Git workflow suitable for small teams

Suitable git story

Introduction

This is a story about a small team and their approach for developing web-services in clojure using Git, GitHub, CircleCi, YouTrack, Docker, Amazon ECS. Most of the tools are easily exchangeable, where the focus will be on git workflow for continuous delivery and a type of agile process with project management tool.

Agile sounds like a marketing stunt in most cases, yet we try to implement some

@abcdw
abcdw / sql-pretty-print.clj
Created April 28, 2018 11:13
Example of sql pretty print. ql/httpkit/cheshire.
(def sql-example
(->
(ql/sql {:ql/with {:_user #:ql {:select :*
:from :user
:where [:ql/= :id [:ql/param 5]]}
:_group {:ql/select :g.*
:ql/from {:u :user}
:ql/joins {:g {:ql/rel :group
:ql/on [:ql/= :g.user_id :u.id]}}}}
:ql/select {:name :u.name :group :g.name}
(def prices
[:car :cow :cow])
(shuffle prices)
(defn init-game []
{:doors (into {} (map-indexed (fn [a b] [a b]) (shuffle prices)))
:doors-count (count prices)
;; :turn 0
})
starting phase `set-SOURCE-DATE-EPOCH'
phase `set-SOURCE-DATE-EPOCH' succeeded after 0.0 seconds
starting phase `set-paths'
environment variable `PATH' set to `/gnu/store/v9smm673l094xv4szq89i76glx323y6g-rust-1.34.0-cargo/bin:/gnu/store/6vs81md6jl8rz6rk0b21apncg5q3nz8m-rust-1.34.0/bin:/gnu/store/bl3pxxj6frg0dww8pj5dvh2d1akwvj47-tar-1.30/bin:/gnu/store/h0c398zan9ibhk4w0c944vp5pwgzkfpd-gzip-1.9/bin:/gnu/store/j74aabxwayjl9yfyrm6ni482gykxq48b-bzip2-1.0.6/bin:/gnu/store/9425b5dwpfc04bb4p58hsjypxghliyr3-xz-5.2.4/bin:/gnu/store/ypiyk8ngn79cz655jrl0hng37xv54yjr-file-5.33/bin:/gnu/store/4bzzz0lzjc9b7bfsnqbq2j22d4fvf433-diffutils-3.6/bin:/gnu/store/a4rxl40jr7gmq8bp3dryq4yq67cwkwiw-patch-2.7.6/bin:/gnu/store/fd621k6fmdnr1yiw0lbvw5spqaa169j3-findutils-4.6.0/bin:/gnu/store/l67sib1ld0fgyf0f4vrzyxnmn4yvimvb-gawk-4.2.1/bin:/gnu/store/lmfddplnplxd03bcqv3w9pynbnr1fp8k-sed-4.5/bin:/gnu/store/02k245xy33cvcnr8vm3lagm9zmb1s2wa-grep-3.1/bin:/gnu/store/5s2nib1lrd2101bbrivcl17kjx1mspw6-coreutils-8.30/bin:/gnu/store/7j3941iannrngdvgb
(ns rk-server.data-sending.pdf
(:require [unifn.core :as u]
[clj-htmltopdf.core :as htmltopdf]
[cheshire.core :as json]
[rk-server.email.core :as email]
[rk-server.data-sending.db :as db]
[rk-server.utils :as ut]
[rk-server.data-request :as data-request]
[rk-server.data-sending.crud :as crud]
[rk-server.data-sending.html :as html]
(ns app.server.core
(:require [clojure.string :as string]
[ironhide.core :as ih]))
(defn -main []
(println "hello"))
(defmethod ih/get-global-sight :ihs/read-only [key args & [ctx]]
[(fn [x] {:ih/ro-value x
:ih/value x})

Nix syntax basics

Intro

Comments