Skip to content

Instantly share code, notes, and snippets.

View achikin's full-sized avatar

Anton Chikin achikin

  • Russia, Voronezh
View GitHub Profile
@achikin
achikin / assignment.md
Last active October 5, 2022 13:51
Test assignment

Given social network posts in the following format:

[
 {"date": "12.10.2019",
  "text": "I love trouts!",
  "likes": [1, 2, 3, 4]},
  
  {"date": "17.10.2019",
  "text": "Hello world!",
 "likes": [1, 2, 3, 4]}б
@achikin
achikin / ast-example.rb
Last active December 15, 2020 11:23
Ruby AST
def somefn(x, y)
x + y
end
somefn(1,2)
@achikin
achikin / keybase.md
Created May 8, 2020 02:29
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 March 6, 2020 21:53
reagent master test run 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:
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
;; -*- 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'
(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 / sub_watch.cljs
Created March 6, 2018 11:30
Test of subscription watchers
(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 February 17, 2018 02:02 — forked from gilbert/DefaultKeyBinding.dict
Add missing keyboard shortcuts on OS X
/*
Create this as a file ~/Library/KeyBindings/DefaultKeyBinding.dict
Then restart your computer.
NOTE: ~ means alt/option
^ means ctrl
*/
{
"~f"="moveWordForward:";
"~b"="moveWordBackward:";
"~<"="moveToBeginningOfDocument:";
@achikin
achikin / clojure_is_for_type_b_personalities.md
Created November 29, 2017 15:16
Clojure is for type B personalities

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