Skip to content

Instantly share code, notes, and snippets.

View ulises's full-sized avatar

Ulises Cervino Beresi ulises

View GitHub Profile
def loop_with_delay(f, delay_in_secs=60):
"""Infinite loop with introduced delay between invocations.
Equivalent to the following construct:
while True:
f()
time.sleep(delay_in_secs)
"""
def wrapped():
f()
def parseRequest(req : String) : Map[String, Any] = {
Map("x" -> parseX(req),
"y" -> parseY(req))
}
def parseX(req : String) : Option[X] = {
...
}
def parseY(req : String) : Option[Y] = {
camila.node> (handshake "u@u" "bob")
{:status ok}
{:name bob@Ulisess-MacBook-Pro, :challenge 3065769371, :flags 32764, :version1 5, :version0 0}
<< <== […] >>
camila.node>
;;; erlang quickfixes
(defvar quickfix-undefined-fn-re
"^function \\(\\w+\\)/\\([0-9]+\\) undefined$"
"Regexp to test whether the flymake error is about an undefined function.")
(defvar quickfix-erlang-fn-skeleton
"%s(%s) ->"
"Skeleton for defining an erlang function.")
(defun quickfix-get-flymake-issue-at-point ()
(defvar quickfix-mode-hook nil)
(defvar quickfix-mode-map
(let ((map (make-keymap)))
(define-key map (kbd "C-c C-f") 'quickfix-at-point)
map)
"Keymap from quickfix minor mode")
(defvar quickfix-mode-handlers
(make-hash-table :test 'equal)
(defun handler (issue-at-point)
;; aca va la magia para arreglar el problema)
;; quickfix-when-text-matches es una funcion que te matchea una regexp
;; con el error reportado por flymake
(defvar predicate
(quickfix-when-text-matches quickfix-undefined-fn-re "define"))
;; aca se registra el handler
(quickfix-add-handler undefined-fn-predicate 'handler)
;;; erlang quickfixes
(defvar quickfix-undefined-fn-re
"^function \\(\\w+\\)/\\([0-9]+\\) undefined$"
"Regexp to test whether the flymake error is about an undefined function.")
(defvar quickfix-erlang-fn-skeleton
"%s(%s) ->"
"Skeleton for defining an erlang function.")
(defun quickfix-get-undefined-function-name-and-arity-at-point (issue-at-point)
Could not find artifact riemann:riemann:jar:0.1.6-SNAPSHOT in clojars (https://clojars.org/repo/)
This could be due to a typo in :dependencies or network issues.
Could not resolve dependencies
from __future__ import with_statement
from fabric.api import local, parallel, env
import time
env.hosts = ["localhost", "localhost", "localhost"]
@parallel
def foo():
from __future__ import with_statement
from fabric.api import run, parallel, env
import time
env.hosts = ["localhost", "localhost", "localhost", "localhost", "localhost", "localhost"]
@parallel
def foo():