Skip to content

Instantly share code, notes, and snippets.

View DeLaGuardo's full-sized avatar
🎯
Focusing

Kirill Chernyshov DeLaGuardo

🎯
Focusing
View GitHub Profile
@DeLaGuardo
DeLaGuardo / retry_decorator.py
Created February 20, 2013 07:40
Decorator "retry" with backoff.
import time
from functools import wraps
def retry(ExceptionToCheck, tries=4, delay=3, backoff=2, logger=None):
def deco_retry(f):
@wraps(f)
def f_retry(*args, **kwargs):
mtries, mdelay = tries, delay
### Keybase proof
I hereby claim:
* I am delaguardo on github.
* I am delaguardo (https://keybase.io/delaguardo) on keybase.
* I have a public key whose fingerprint is D08D 4FCB 8E78 5790 B22C 2D8B E64D 46BC FE86 8A1F
To claim this, I am signing this object:
Local: master ~/Projects/aviasales/jr-content/
Remote: master @ origin ([email protected]:KosyanMedia/jr-content.git)
Head: 7904c31 Add method for fetching weather data with average computation
Stashes:
0: WIP on master: 1e56a77 Add cheapest_flights property for cities
1: WIP on master: 1330763 Fix encoding in currencies
2: On master: 123
3: On master: Snapshot taken at 2015-04-28 17:19:04
4: WIP on master: a1dcf52 cheapest_domestic_internationl_flights for airline
@DeLaGuardo
DeLaGuardo / pragmatapro-font-lock-symbols-v2.el
Last active February 28, 2024 01:27
Snippet for support ligatures from PragmataPro font in Emacs
;; Enable ligatures without prettify-symbols
(provide 'add-pragmatapro-symbol-keywords)
(defconst pragmatapro-fontlock-keywords-alist
(mapcar (lambda (regex-char-pair)
`(,(car regex-char-pair)
(0 (prog1 ()
(compose-region (match-beginning 1)
(match-end 1)
### Keybase proof
I hereby claim:
* I am delaguardo on github.
* I am delaguardo (https://keybase.io/delaguardo) on keybase.
* I have a public key ASCuGGRAQF2wfy-ooyMNloSDB33IEfsyI68GpEhU7tIpZAo
To claim this, I am signing this object:
# clj -Sdeps '{:deps {amazonica {:mvn/version "0.3.142" :exclusions [com.amazonaws/aws-java-sdk com.amazonaws/amazon-kinesis-client]} com.amazonaws/aws-java-sdk-s3 {:mvn/version "1.11.475"} com.amazonaws/aws-java-sdk-core {:mvn/version "1.11.475"}}}' -Stree
org.clojure/clojure 1.10.0
org.clojure/core.specs.alpha 0.2.44
org.clojure/spec.alpha 0.2.176
org.clojure/tools.trace 0.7.10
com.amazonaws/aws-java-sdk-core 1.11.475
com.fasterxml.jackson.core/jackson-databind 2.6.7.2
com.fasterxml.jackson.core/jackson-core 2.6.7
com.fasterxml.jackson.core/jackson-annotations 2.6.0
@DeLaGuardo
DeLaGuardo / deps.edn
Last active September 13, 2019 12:05
{:deps {org.clojure/clojure {:mvn/version "1.10.1"}}
:paths ["."]}
@DeLaGuardo
DeLaGuardo / deps.edn
Created October 22, 2019 12:26
Lambda analyze
{:paths ["."]}
(defmulti foo (fn [x & _] x))
(defmethod foo :sum [_ & args] (apply + args))
(apply foo (list* :sum (range 10))) ;; => ok
(apply foo (list* :sum (range 25))) ;; => Invalid arity exception