Skip to content

Instantly share code, notes, and snippets.

View funivan's full-sized avatar
🇺🇦
deliver bits

Ivan Shcherbak funivan

🇺🇦
deliver bits
View GitHub Profile
object Converter {
case class Def(arabic: Int, roman: String)
implicit class Arabic(arabic: Int) {
def ~>(roman: String): Def = Def(arabic, roman)
}
val map = List(
1 ~> "I", 10 ~> "X", 100 ~> "C",1000 ~> "M",
2 ~> "II", 20 ~> "XX",200 ~> "CC", 2000 ~> "MM",
3 ~> "III",30 ~> "XXX", 400 ~> "CD", 3000 ~> "MMM",
4 ~> "IV", 40 ~> "XL", 300 ~> "CCC",
#!/usr/bin/env bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
docker run --rm -v "$SCRIPT_DIR":/app \
-w "/app" \
-it "mileschou/xdebug:7.4" \
"./vendor/bin/phpunit"

SH

Current script directory

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"

Full path to the directory

realpath ../tests

Keybase proof

I hereby claim:

  • I am funivan on github.
  • I am funivan (https://keybase.io/funivan) on keybase.
  • I have a public key whose fingerprint is 5ED6 311B 0EC4 A39B E7B3 BB53 FC89 9F51 7298 6F73

To claim this, I am signing this object:

#!/bin/bash
if [ ! -f /tmp/brightness ]; then
BRIGHTNESS=$(xrandr --verbose | grep -i brightness | cut -f2 -d ' ' | head -n1)
else
BRIGHTNESS=$(cat /tmp/brightness)
fi
# Increment (1) or decrement (0)
if [[ "$1" == "--down" ]]; then
<?php
/**
* This class is ok.
*/
class User {
/**
* @var string
*/
@funivan
funivan / install.sh
Last active February 6, 2019 07:57
Arduino led strip control
#!/bin/bash
mktouch() {
for f in "$@"; do
sudo mkdir -p -- "$(dirname -- "$f")"
sudo touch -- "$f"
done
}
class EqExtension extends AbstractExtension {
/**
* Returns extension name.
*
* @return string
*/
public function getName() {
return 'function';
}
@funivan
funivan / CalculateLines.py
Last active December 7, 2017 14:06
Sublime plugin
import sublime, sublime_plugin
class CalculateLinesCommand(sublime_plugin.TextCommand):
def run(self, edit):
lines={}
region = sublime.Region(0, self.view.size())
for lineRegion in self.view.lines(region):
key = self.view.substr(lineRegion)
key = key.strip(' \t\n\r')
@funivan
funivan / info.md
Created January 13, 2016 09:39
xdebug 2.3 phpstorm 10.0.3 build 143.1770