Skip to content

Instantly share code, notes, and snippets.

Avatar

Nikita Fedyashev nfedyashev

View GitHub Profile
View array-utils.txt
The simplest implementation might look like this:
<!-- language: lang-ruby -->
class ArrayUtils
def self.multiplos(num, step)
step.step(num * step, step).to_a
end
end
View array-utils.md

The simplest implementation might look like this:

class ArrayUtils def self.multiplos(num, step) step.step(num * step, step).to_a end end

View emacsclient-insert.el
;; (server-start)
emacsclient --eval '(with-current-buffer "*scratch*" (insert "do you see me?"))'
View clara-food-compatibility-wip.clj
(ns clara.compatibility
(:require [clara.rules.accumulators :as acc]
[clara.tools.tracing :as tracing]
[clara.tools.inspect]
[clara.rules :refer :all]))
(defrecord Compatible [items])
(defrecord Incompatible [items])
(defrecord Protein [])
View spacemacs.el
;; -*- 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
View async-factory.clj
(ns lispcast-clojure-core-async.core
(:require
[lispcast-clojure-core-async.exercises :as ex]
[lispcast-clojure-core-async.factory :refer :all]
[clojure.core.async :as async
:refer [>! <! alts! chan put! go]]))
(defn build-car [n]
(println n "Starting build")
(let [body (loop []
View clojuredocs cider.txt
(use 'clojure.repl)
M-x M-x cider-clojuredocs
@nfedyashev
nfedyashev / cider.el
Created May 23, 2020
Start Cider from Emacs
View cider.el
;;Start Cider from Emacs:
;;Put this in your Emacs config file:
(setq cider-cljs-lein-repl
"(do (require 'figwheel-sidecar.repl-api)
(figwheel-sidecar.repl-api/start-figwheel!)
(figwheel-sidecar.repl-api/cljs-repl))")
;;Navigate to a clojurescript file and start a figwheel REPL with cider-jack-in-clojurescript or (C-c M-J)
@nfedyashev
nfedyashev / rspec-xvfb-phantomjs.sh
Created May 23, 2020
Run poltergeist/phantomjs webdriver via ssh
View rspec-xvfb-phantomjs.sh
xvfb-run --auto-servernum rspec ./spec/features/sign_up_spec.rb:7
View emacs-timer.el
(defun show-msg-after-timer ()
"Show a message after timer expires. Based on run-at-time and can understand time like it can."
(interactive)
(let* ((msg-to-show (read-string "Enter msg to show: "))
(time-duration (read-string "Time? ")))
(message time-duration)
(run-at-time time-duration nil #'message-box msg-to-show)))
You can’t perform that action at this time.