I hereby claim:
- I am mtavkhelidze on github.
- I am mtavkhelidze (https://keybase.io/mtavkhelidze) on keybase.
- I have a public key ASAnwKsslY4uA6pNahXu0wZsr_kIhXEhY0es1CW357irrwo
To claim this, I am signing this object:
| #!/usr/bin/env bash | |
| till_date=$(echo $1 | tr -d "-") | |
| echo ${till_date} | egrep -q "([0-9]){8,}" | |
| (($? != 0)) && { | |
| echo "Invalid date." 1>&2 | |
| echo "Usage: days-till YYYY-MM-DD" 1>&2 |
| Alamofire.request(urlString).responseJSON { response in | |
| guard case let .failure(error) = response.result else { return } | |
| if let error = error as? AFError { | |
| switch error { | |
| case .invalidURL(let url): | |
| print("Invalid URL: \(url) - \(error.localizedDescription)") | |
| case .parameterEncodingFailed(let reason): | |
| print("Parameter encoding failed: \(error.localizedDescription)") | |
| print("Failure Reason: \(reason)") |
| # custom IntelliJ IDEA VM options | |
| # https://docs.oracle.com/javase/8/docs/technotes/tools/unix/java.html | |
| -ea | |
| -Xms4096m | |
| -Xmx8192m | |
| -XX:CMSInitiatingOccupancyFraction=65 | |
| -XX:MaxMetaspaceSize=512m | |
| -XX:MaxTenuringThreshold=1 |
| interface Functor<T> { | |
| map<U>(f: (x: T) => U): Functor<U> | |
| } | |
| class Box<T> implements Functor<T> { | |
| value: T | |
| constructor(x: T) { | |
| this.value = x | |
| } | |
| map<U>(f: (x: T) => U): Box<U> { |
| /** | |
| * @constructor | |
| */ | |
| function* range(from, until) { | |
| let i = from; | |
| const stop = until ? i => i >= until : () => false; | |
| while (true) { | |
| if (!stop(i)) { | |
| yield i; | |
| } else { |
| /** | |
| * Curry the hell out of any function. | |
| * | |
| * @param f function | |
| * @returns function | |
| */ | |
| function curry(f) { | |
| const arity = f.length; | |
| // preserve original `this` in case we're curring a class method; |
| import scala.language.reflectiveCalls | |
| def repeat(command: => Unit) = new { | |
| def until(condition: => Boolean): Unit = | |
| if (condition) { | |
| command | |
| until(condition) | |
| } else () | |
| } |
| function NonEmpty(elem, left, right) { | |
| const contains = (x) => { | |
| if (x < elem) | |
| return left.contains(x); | |
| else if (x > elem) | |
| return right.contains(x); | |
| else if (x === elem) | |
| return true; | |
| else |
I hereby claim:
To claim this, I am signing this object:
| #!/usr/bin/env bash | |
| function usage() { | |
| echo "Usage: $(basename $0) -l/-u [-g -h]" 1>&2 | |
| echo "Options are:" 1>&2 | |
| echo " -l list packages" 1>&2 | |
| echo " -u update packages" 1>&2 | |
| echo " -g go global" 1>&2 | |
| echo " -h show this help" 1>&2 | |
| exit 1 |