Skip to content

Instantly share code, notes, and snippets.

Avatar

Anton Chikin achikin

View GitHub Profile
View ast-example.rb
def somefn(x, y)
x + y
end
somefn(1,2)
View keybase.md

Keybase proof

I hereby claim:

  • I am achikin on github.
  • I am achikin (https://keybase.io/achikin) on keybase.
  • I have a public key whose fingerprint is B002 7CD2 7BBB A3A6 2AE2 B096 90B1 09AF 65F5 F54B

To claim this, I am signing this object:

@achikin
achikin / test.log
Created Mar 6, 2020
reagent master test run log
View test.log
~/src/reagent (merge-props-fix) → ./run-tests.sh
##
## TESTING browser-cljsjs
##
+ rm -rf target/cljsbuild/test/
+ lein doo chrome-headless test once
;; ======================================================================
;; Testing with Chrome-headless:
View gist:f51202a77dae20772c58896a1fb90289
decomp.core=> (defn xxx [a b] (+ a b))
#'decomp.core/xxx
decomp.core=> (dc/decompile (fn [] (xxx 1 2)))
// Decompiling class: decomp/core$fn__1632
package decomp;
import clojure.lang.*;
public final class core$fn__1632 extends AFunction
@achikin
achikin / assignment.md
Last active Dec 17, 2019
Test assignment
View assignment.md

Given social network posts in the following format

[
 {"date": "12.10.2019",
  "text": "I love trouts!",
  "likes": [1, 2, 3, 4]},
  ...
]

likes is a list of user ids that liked a post

View .spacemacs
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;; `+distribution'. For now available distributions are `spacemacs-base'
@achikin
achikin / sub_watch.cljs
Created Mar 6, 2018
Test of subscription watchers
View sub_watch.cljs
(ns whatever.sub-test
(:require [reagent.core :as r]
[reagent.ratom :as ratom]
[re-frame.core :as rf]))
(rf/reg-sub :test (fn [db] (:test db)))
(rf/reg-event-db :set-test (fn [db [_ newval]] (assoc db :test newval)))
(rf/reg-event-db :set-test-changed (fn [db [_ newval]] (assoc db :test-changed newval)))
(rf/reg-sub :test-changed (fn [db _] (:test-changed db)))
@achikin
achikin / DefaultKeyBinding.dict
Created Feb 17, 2018 — forked from gilbert/DefaultKeyBinding.dict
Add missing keyboard shortcuts on OS X
View DefaultKeyBinding.dict
/*
Create this as a file ~/Library/KeyBindings/DefaultKeyBinding.dict
Then restart your computer.
NOTE: ~ means alt/option
^ means ctrl
*/
{
"~f"="moveWordForward:";
"~b"="moveWordBackward:";
"~<"="moveToBeginningOfDocument:";
View gist:da01023d4f5a373cb1a929ce4b230e63
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;; `+distribution'. For now available distributions are `spacemacs-base'
;; or `spacemacs'. (default 'spacemacs)
dotspacemacs-distribution 'spacemacs
;; Lazy installation of layers (i.e. layers are installed only when a file
@achikin
achikin / clojure_is_for_type_b_personalities.md
Created Nov 29, 2017
Clojure is for type B personalities
View clojure_is_for_type_b_personalities.md

The other day, I was wondering why Clojure fits my brain so well. I think I was relaxing on my old couch, drinking cheap beer, eating a gas station pastry, and drawing doodles on a stack of overdue bills I forgot to pay. Little did I realize, these things are all connected.

I have a hypothesis that people choose programming languages based on their personality. For the purposes of this write-up, I’ll use the well-known distinction between type A and type B people. This may be pop psychology stuff, but it’s convenient for my point so in the spirit of American politics I will treat it as fact.

Type A vs Type B

Type A people are very organized, competitive, punctual, and like to plan ahead. When I was a kid, these were the ones who had perfect grades, competed in track or swimming, and on top of that they were nice people so I couldn't even hate the fuckers. Type B people, on the other hand, are laid back and like to do things spontaneously. Like The Dude from The Big Lebowski, they are comfortable with