Skip to content

Instantly share code, notes, and snippets.

View gregkonush's full-sized avatar
🏠
Working from home

Greg Konush gregkonush

🏠
Working from home
View GitHub Profile
@gregkonush
gregkonush / query.json
Created January 13, 2024 02:53
introspection_query
{
"query": "query IntrospectionQuery {
__schema {
queryType { name }
mutationType { name }
subscriptionType { name }
types {
...FullType
}
directives {
@gregkonush
gregkonush / install-obsidian.sh
Created November 13, 2022 21:46 — forked from shaybensasson/install-obsidian.sh
Installing Obsidian (an advanced markdown editor) on Ubuntu
#!/usr/bin/env bash
# see https://forum.obsidian.md/t/gnome-desktop-installer/499
set -euo pipefail
icon_url="https://cdn.discordapp.com/icons/686053708261228577/1361e62fed2fee55c7885103c864e2a8.png"
#dl_url=${1:-}
dl_url=$( curl -s https://api.github.com/repos/obsidianmd/obsidian-releases/releases/latest \
| grep "browser_download_url.*AppImage" | tail -n 1 | cut -d '"' -f 4 )
@gregkonush
gregkonush / eval.kt
Created September 3, 2022 21:54
eval.kt
import org.graalvm.polyglot.Context
import org.graalvm.polyglot.Value
fun main() {
Context.create().use { context ->
val function: Value = context.eval("js", """
(
function square(param) {
return param * param;
}
@gregkonush
gregkonush / machine.js
Created October 22, 2019 19:55
Generated by XState Viz: https://xstate.js.org/viz
const promiseMachine = Machine({
id: 'promise',
initial: 'pending',
states: {
pending: {
on: {
RESOLVE: 'resolved',
REJECT: 'rejected'
}
},
@gregkonush
gregkonush / machine.js
Created October 22, 2019 19:50
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@gregkonush
gregkonush / pairwise_schultze_method.py
Last active August 30, 2019 04:29
schultze method
master_votes = ["A", "B", "C", "D", "E"]
candidates = 5
votes = [
(5, "ACBED"),
(5, "ADECB"),
(8, "BEDAC"),
(3, "CABED"),
(7, "CAEBD"),
(2, "CBADE"),

Keybase proof

I hereby claim:

  • I am djkalmyk on github.
  • I am kalmyk (https://keybase.io/kalmyk) on keybase.
  • I have a public key ASCRsQ537GFcZaYXzNAGY8SZP2TdNA3cTBdJcQLwvR00vAo To claim this, I am signing this object:
{
  "body": {
    "key": {
@gregkonush
gregkonush / virtualbox_docker.sh
Created August 26, 2017 22:09
host docker driver on oracle virtual box
docker-machine create --driver virtualbox default
docker-machine ls
docker-machine env default
eval "$(docker-machine env default)"
@gregkonush
gregkonush / ubuntu_on_windows.sh
Created August 26, 2017 05:07
Install ubuntu bash in windows 10
# 1. Settings > Update & Security > For Developers > Developer Mode
# 2. Control Panel > Programs > Turn Windows Features On or Off > Windows Subsystem for Linux(Beta)
# 3. cmd => lxrun /install /y
@gregkonush
gregkonush / no_sudo.sh
Created August 26, 2017 05:04
sudo commands without password ubuntu
sudo echo "$NAME_OF_USER ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/90-cloudimg-ubuntu