Skip to content

Instantly share code, notes, and snippets.

View nbeloglazov's full-sized avatar

Mikita Belahlazau nbeloglazov

View GitHub Profile
nbeloglazov / flipping.clj
Created July 20, 2017 03:38
Flipping drawing
(ns test.core
(:require [quil.core :as q]))
(defn draw []
(q/background 255)
(q/fill 0)
(q/with-translation [(/ (q/width) 2)
(/ (q/height) 2)]
nbeloglazov /
Last active April 12, 2017 06:25
Example of using Processing.selectInput() from Quil.
nbeloglazov / longtask.clj
Created April 5, 2017 06:03
Example of using long-running background tasks with Quil. Quil's UI thread only displays data while background task perform CPU-intensive work (multiplying matrices) without blocking UI thread.
(ns longtask.core
(:require [quil.core :as q]
[quil.middleware :as m]))
; This program shows an example how to integrate long-running
; background tasks into Quil sketch. Clicking on the left or
; right half of the screen starts a new background task which does following:
; 1. Generates random square matrix of size rand of [100, 200, 500, 1000]
; 2. Multiplies matrix by itself. During the multiplication background thread
; updates (:progress state) value so Quil can display the progress.
nbeloglazov / play_all_audio_files.js
Last active December 11, 2016 20:32
Script for Rachel's English site to play all audio recordings in soundboards session. Each recording will be played 3 times with pauses for you to repeat. How to use: 1. go to page with audio recordings 2. in url type "javascript:" and paste this script after colon 3. hit enter, it should start playing recordings one by one
function playAndWait(el) {
return new Promise((resolve) => { => {
setTimeout(resolve, (el.duration * 2.5) * 1000);
function swapEveryPair(els) {
const elements = Array.from(els);
(defproject drawing "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url ""}
:dependencies [[org.clojure/clojure "1.8.0"]
[quil "2.4.0"]])
From 3e49631e23f20c784fe70fc0d76bb3a58c4b8da6 Mon Sep 17 00:00:00 2001
From: Nikita Beloglazov <>
Date: Sat, 12 Mar 2016 11:35:10 -0800
Subject: [PATCH] Optimize dump. Reduces size of optimizations SIMPLE binary
from 6.4M to 2.7M
src/main/cljs/cljs/js.clj | 2 +-
src/main/cljs/cljs/js.cljs | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
(ns my.core
(:require [cljs.nodejs :as nodejs]
[clojure.string :as cstr]))
(def bar-source
nbeloglazov /
Last active August 29, 2015 14:13
Setting up Hatnik to automatically update version in README
  1. Login to
  2. Click "Add action".
  3. Enter library.
  4. Change action type to Pull Request.
  5. Enter you repository.
  6. Setup pull request operation:, regex={{library}} "[^"]+", replacement={{library}} "{{version}}".
  7. Test pull request if you want to. It will open pull request using "2.3.4" as "new" version for the library. To test pull request use "Test" button.
  8. Click "Create".

Note: Hatnik will not open pull request if version in README is correct, only if you forget to update it next time you do release.

(ns sandbox.core
(:use [incanter core io charts]))
(use '[incanter core io charts])
(def data (read-dataset "" :header true))
(def head-data (head 10 data))
nbeloglazov / packer.clj
Last active March 7, 2023 06:49
Creates fat jar for jogl and gluegen.jar.
(ns quil-utils.packer
(:require [cemerick.pomegranate.aether :as p]
[ :as io])
(:import [ ZipFile ZipEntry ZipOutputStream]
(defn jars [artifact version]
(->> [[artifact version]]
(p/resolve-dependencies :repositories {"JogAmp" "" "central" ""} :coordinates)