Skip to content

Instantly share code, notes, and snippets.

View mprokopov's full-sized avatar

Maksym Prokopov mprokopov

View GitHub Profile
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="nexus"
# Example aliases
@mprokopov
mprokopov / gist:d283a060c40252dc247b
Created June 22, 2015 12:47
One-liner for fetching nested item from hash-map by link value
(def sidebar-items [{ :name "Dashboard" :color "red" :icon "dashboard" :link "/dashboard" }
{ :name "Обращения" :color "blue" :icon "comments-2" :link "/ticket" }
{ :submenu [
{ :name "Инциденты" :icon "bug" :link "/incidents" }
{ :name "Запросы на обслуж" :icon "basket" :link "/requests" }
{ :name "Запросы на изм" :icon "cog" :link "/rfcs" }
{ :name "Фидбеки" :icon "comments" :link "/feedbacks" }]}
{ :name "Изменения" :icon "cog" :link "/changes" }
{ :name "Проблемы" :icon "shit" :color "green" :link "/problems" }
{ :name "Знания" :icon "book" :link "/knowledges" }
@mprokopov
mprokopov / entities.clj
Created December 29, 2016 11:36
treading macro with partial for placement argument for func as second
(defn assign-durations [{:keys [resolve_at resolved_at response_at responded_at] :as v}]
(-> v
(assign-duration [response_at responded_at] :response-left)
(assign-duration [resolve_at resolved_at] :resolve-left)))
;; assign-duration
(-> (first (select tickets (where {:id 25029})))
(select-keys [ :resolve_at :resolved_at :responded_at :response_at :resolve-left :response-left])
(select-keys [:resolve_at :resolved_at])
vals
@mprokopov
mprokopov / core.cljs
Last active November 1, 2019 21:05
rum + material-ui
(ns speakup.core
(:require [rum.core :as rum]
[cljs-react-material-ui.core :refer [get-mui-theme color]]
[cljs-react-material-ui.icons :as ic]
[cljs-react-material-ui.rum :as ui]
[cljs-react-material-ui.chip-input.rum :refer [chip-input]]))
(enable-console-print!)
;; (println "This text is printed from src/speakup/core.cljs. Go ahead and edit it and see reloading in action.")
@mprokopov
mprokopov / project.clj
Created February 27, 2017 12:39
figwheel + rum + material-ui
(defproject speakup "0.1.0-SNAPSHOT"
:description "FIXME: write this!"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:min-lein-version "2.7.1"
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.9.229"]
## run sinatra + ssl + thin within command line
thin --debug --rackup config.ru start --ssl --ssl-key-file=k.key --ssl-cert-file=c.crt --ssl-disable-verify
@mprokopov
mprokopov / main.cljs
Created December 10, 2017 19:19
Pure ClojureScript ajax JSON remote call with goog.net.XhrIo
(ns test3.main
(:require [goog.dom :as gdom]
[goog.net.XhrIo]
[goog.object :as gobj]))
(defn user-list
"returns HTML string from users list of maps m"
[m]
(str "<ul>"
(apply str
ace-editor:1.1
ansible:1.0
apache-httpcomponents-client-4-api:4.5.5-3.0
authentication-tokens:1.3
authorize-project:1.3.0
aws-credentials:1.27
aws-java-sdk:1.11.594
bouncycastle-api:2.17
branch-api:2.5.4
build-monitor-plugin:1.12+build.201809061734
@mprokopov
mprokopov / gist:39e5646e1b9c3b22bb34fbf82649ea77
Created August 7, 2019 09:36
jenkins plugins 2019-08-07
ace-editor:1.1
ansible:1.0
ant:1.9
antisamy-markup-formatter:1.5
apache-httpcomponents-client-4-api:4.5.5-3.0
authentication-tokens:1.3
authorize-project:1.3.0
aws-credentials:1.27
aws-java-sdk:1.11.594
bouncycastle-api:2.17
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC63qEZsm1GqdJxSpmG9ns5XANku/ZyxGI3a4xFRtPE+m8YOaOxfTc4Kom498eKrfIruD3h5LKMpxHND6TyhZ/6bUFBkCEMnBSPLramwxqvkMn1XtwJJsj6i3Wns3RXmLTRi3Yaa8cZsN2u3YrSUk3xZfh6LwMW5fMs/I3/lcRSow0Vp9lWCd0B3NeaT/KN8/HeeiYtdc1paYvrskIco3BasZ/YouPYhYE9kgspSwQifEIKZ2htDuueW0ZbttFoKMRLA8g4lP7BPyAUIls82XjTl0mAsjZxv4vloVyV7eKVxvHd3YBbEqtbtt0sCsXGtDVhoRKRDGC/TbBRBXxFAuW/ nexus@MacBook-Pro-Maksym.local