Skip to content

Instantly share code, notes, and snippets.

View rashkur's full-sized avatar
:octocat:

Roman S rashkur

:octocat:
View GitHub Profile
@rashkur
rashkur / undefinedVariable.groovy
Created September 23, 2020 15:23 — forked from pradhyu/undefinedVariable.groovy
Check if a variable is undefined in groovy
// checking bindings snippets
if (binding.hasVariable('superVariable')) {
// your code here
}
An easy solution to this is the following:
if (binding.variables.containsKey("bindingVar")) {
// do something
}
Or if you’d like to get a null value for an optional binding:
# Homebrew has done away with options in all of their core formulas
# discussion on this change here: https://github.com/Homebrew/homebrew-core/issues/31510
# install it like this:
brew install https://gist.githubusercontent.com/rashkur/cfcc377bd378fb709dff949fcf5bb889/raw/3333ea8f44cee6ed54a1a134dab99599dc32b6ae/ffmpeg.rb \
--with-aom \
--with-chromaprint \
--with-fdk-aac \
--with-fontconfig \
--with-freetype \
@rashkur
rashkur / vel.txt
Last active December 1, 2019 11:19
ВЕЛИЧИЕ… ДО НЕПРИЛИЧИЯ
Юрий Кузнецов
пианист, композитор, заслуженный деятель искусств Украины
Прем’єр-міністру України пані Ю. Тимошенко
Міністру культури і туризму України пану В. Вовкуну
Міністру освіти та науки України пану І. Вакарчуку
Голові Комітету з питань освіти та науки Верховної Ради України пану В. Полохало
@rashkur
rashkur / gist:a5ba84bfda890549f7a68f55fcdb627f
Created June 11, 2019 23:37
windows 10 install from mac usb
1) diskutil eraseDisk FAT32 "WINDOWS10" MBRFormat disk3
2) copy files from iso to usb
3) boot in UEFI mode from flash
@rashkur
rashkur / build.bash
Last active June 4, 2019 12:03
build clang from tar.xz sources on centos 7
yum -y install centos-release-scl which devtoolset-7-gcc* libxml2-devel zlib-devel
scl enable devtoolset-7 bash
gcc --version
cat >/tmp/llvm.sh <<'EOL'
#LLVMDIR="/usr/local/src/llvm"
#build in ramdisk if it's >= 8GB
LLVMDIR="/run/llvm"
LLVMVER="8.0.0"
TEST_CC="/opt/rh/devtoolset-7/root/usr/bin/cc"
@rashkur
rashkur / docker-destroy-all.sh
Created May 22, 2019 11:52 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
#!/usr/bin/env python3
import asyncio
import socket
async def handle_echo(reader, writer):
addr = writer.get_extra_info('peername')
while True:
data = await reader.read(4096)
@rashkur
rashkur / limitConcurrentGoroutines.go
Created October 5, 2018 12:07 — forked from AntoineAugusti/limitConcurrentGoroutines.go
Limit the maximum number of goroutines running at the same time
package main
import (
"flag"
"fmt"
"time"
)
// Fake a long and difficult work.
func DoWork() {
@rashkur
rashkur / SimpleHTTPServerWithUpload.py
Created April 2, 2018 08:22 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@rashkur
rashkur / golang-tls.md
Created March 29, 2018 18:37 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)