Skip to content

Instantly share code, notes, and snippets.

View alexander-yakushev's full-sized avatar
🪖
Defending against russian invasion

Oleksandr Yakushev alexander-yakushev

🪖
Defending against russian invasion
View GitHub Profile
@alexander-yakushev
alexander-yakushev / twitter-hide-garbage.js
Last active August 10, 2019 16:31
TamperMonkey script for hiding the distracting UI elements on Twitter
// ==UserScript==
// @name Twitter hide garbage
// @namespace http://tampermonkey.net/
// @version 0.1
// @match https://twitter.com/*
// @grant GM_addStyle
// ==/UserScript==
(function() {
'use strict';
@alexander-yakushev
alexander-yakushev / patch.lua
Created June 11, 2012 14:41
Fix move_to_screen in AwesomeWM
function smart_movetoscreen(c, s)
local was_maximized = { h = false, v = false }
if c.maximized_horizontal then
c.maximized_horizontal = false
was_maximized.h = true
end
if c.maximized_vertical then
c.maximized_vertical = false
was_maximized.v = true
end
@alexander-yakushev
alexander-yakushev / crash.txt
Created November 1, 2019 20:13
Shenandoah JDK8 30.10 crash
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f65b7f497c7, pid=1, tid=0x00007f61ec4e9700
#
# JRE version: OpenJDK Runtime Environment (8.0) (build 1.8.0-builds.shipilev.net-openjdk-shenandoah-jdk8-b450-20191030-aarch64-shenandoah-jdk8u232-b09)
# Java VM: OpenJDK 64-Bit Server VM (25.71-b450-20191030-aarch64-shenandoah-jdk8u232-09 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0x8b97c7] ObjectMonitor::enter(Thread*)+0x6d7
#
# Core dump written. Default location: /app/core or core.1
@alexander-yakushev
alexander-yakushev / launchbar.lua
Last active April 9, 2020 17:08
Quick launchbar widget for Awesome WM
-- Quick launchbar widget for Awesome WM
-- http://awesome.naquadah.org/wiki/Quick_launch_bar_widget/3.5
-- Put into your awesome/ folder and add the following to rc.lua:
-- local launchbar = require('launchbar')
-- local mylb = launchbar("/path/to/directory/with/shortcuts/")
-- Then add mylb to the wibox.
local layout = require("wibox.layout")
local util = require("awful.util")
local launcher = require("awful.widget.launcher")
@alexander-yakushev
alexander-yakushev / debugger-wannabe.lisp
Created February 6, 2013 13:22
Debugging functions for SBCL
(declaim (optimize (debug 2)))
;; Part one.
(defun line-number (fname code-loc)
(let* ((all-offsets (sb-di::debug-source-start-positions code-loc))
;; Get last item from the array, I haven't found anything
;; like 'pop' to do it better.
(offset (aref all-offsets (- (length all-offsets) 1))))
(with-open-file (f fname)
@alexander-yakushev
alexander-yakushev / "Stonebreakers" by Ivan Franko
Last active October 5, 2022 04:27
Amateur translation from Ukrainian to English of the poem "Каменярі" ("Kamenyari") written by Іван Франко (Ivan Franko) in 1878.
I had a dream. Like there is ahead
And endless, empty and the wildest plane.
And I stand there, held by iron chain,
Under the tall rock made from finest granite
And next to me are thousands just like me.
The face of everyone is marked by woe and sorrow,
And eyes of everyone contain fervor of love.
And hands of everyone are chained with snakes of iron,
And every shoulder's bent low to the ground,
@alexander-yakushev
alexander-yakushev / lustrous.lua
Last active December 24, 2022 15:39
Module for calculating sunrise/sunset times for a given location
-- Module for calculating sunrise/sunset times for a given location
-- Based on algorithm by United Stated Naval Observatory, Washington
-- Link: http://williams.best.vwh.net/sunrise_sunset_algorithm.htm
-- @author Alexander Yakushev
-- @license CC0 http://creativecommons.org/about/cc0
-- Module lustrous
local lustrous = {
update_interval = 600
}
@alexander-yakushev
alexander-yakushev / asyncshell.lua
Last active April 28, 2023 13:07
Asyncronous io.popen replacement for Awesome
-- Asynchronous io.popen for Awesome WM.
-- How to use...
-- ...asynchronously:
-- asyncshell.request('wscript -Kiev', function(f) wwidget.text = f:read("*l") end)
-- ...synchronously
-- wwidget.text = asyncshell.demand('wscript -Kiev', 5):read("*l") or "Error"
local awful = require('awful')
asyncshell = {}
(ns ray-tracer
(:import java.util.List
java.awt.Color
java.awt.image.BufferedImage
javax.imageio.ImageIO
java.io.File))
(alter-var-root #'*compiler-options* (constantly {:direct-linking true}) )
(set! *unchecked-math* :warn-on-boxed)
@alexander-yakushev
alexander-yakushev / deps.edn
Last active September 4, 2023 12:56
System-wide tools.deps configuration and code (for London Clojurians meetup 05'23)
{:deps {org.clojure/clojure {:mvn/version "1.12.0-alpha3"}}
:aliases {:dev {:extra-deps
{com.clojure-goes-fast/clj-async-profiler {:mvn/version "1.0.4"}
com.clojure-goes-fast/clj-java-decompiler {:mvn/version "0.3.4"}
com.clojure-goes-fast/clj-memory-meter {:mvn/version "0.3.0"}}
:jvm-opts ["-Djdk.attach.allowAttachSelf"
"-XX:+UseG1GC"
"-XX:-OmitStackTraceInFastThrow"