Skip to content

Instantly share code, notes, and snippets.

View xmonader's full-sized avatar
🏠
Working from home

xmonader xmonader

🏠
Working from home
View GitHub Profile
diff --git a/src/servy.nim b/src/servy.nim
index 3a90e78..8954982 100644
--- a/src/servy.nim
+++ b/src/servy.nim
@@ -407,8 +407,8 @@ proc newResponse*(): Response =
result.httpver = HttpVer11
result.headers = newHttpHeaders()
-type MiddlewareFunc* = proc(req: Request, res: Response): Future[bool] {.async, nimcall, gcsafe, locks: 0.}
-type HandlerFunc* = proc(req: Request, res: Response) : Future[void] {.nimcall, async.}
require "json"
# class Location
# JSON.mapping(
# lat: Float64,
# lng: Float64,
# )
# end
# class House
@xmonader
xmonader / README.md
Created April 18, 2020 21:15 — forked from cellularmitosis/README.md
Tech Links
jumpscaleX_libs/JumpscaleLibs/data/markdown/MarkdownFactory.py:39: # #use prefab to install components required to get pdf generation to work
jumpscaleX_libs/JumpscaleLibs/sal/docker/Container.py:30: self._prefab = None
jumpscaleX_libs/JumpscaleLibs/sal/docker/Container.py:70: def prefab(self):
jumpscaleX_libs/JumpscaleLibs/sal/docker/Container.py:71: if self._prefab is None:
jumpscaleX_libs/JumpscaleLibs/sal/docker/Container.py:72: self._prefab = j.tools.prefab.get(self.executor, usecache=False)
jumpscaleX_libs/JumpscaleLibs/sal/docker/Container.py:73: return self._prefab
jumpscaleX_libs/JumpscaleLibs/sal/docker/Docker.py:425: result = ex.prefab.system.user.passwd("root", rootpasswd)
jumpscaleX_libs/JumpscaleLibs/sal/kvm/Pool.py:13: self.poolpath = self.controller.executor.prefab.core.joinpaths(self.controller.base_path, self.name)
jumpscaleX_libs/JumpscaleLibs/sal/kvm/Pool.py:35: self.controller.executor.prefab.core.dir_ensure(self.poolpath)

builders

  • mongo/mongocluster/tarantool/tidb/ledis
  • sockexec
  • etcd
  • hadoop
  • grafana (requires update)
  • gateone
  • geodns
  • zeroboot
# This is just an example to get you started. A typical binary package
# uses this file as the main entry point of the application.
import strformat, tables, json, strutils, sequtils, hashes, net, asyncdispatch, asyncnet, os, strutils, parseutils, deques, options, net
type ForwardOptions = object
listenAddr*: string
listenPort*: Port
toAddr*: string
toPort*: Port
@xmonader
xmonader / myproj.nim
Last active October 23, 2019 19:25
myproj.nim
# This is just an example to get you started. A typical binary package
# uses this file as the main entry point of the application.
import strformat, tables, json, strutils, asyncdispatch, asyncnet, strutils, parseutils, options, net
from cgi import decodeUrl
import terminaltables
import mimetypes
type
from gevent import monkey; monkey.patch_all()
import time, os, sys, inspect
from pickle import loads as pickle_loads, dumps as pickle_dumps
from dill import loads as dill_loads, dumps as dill_dumps
from redis import Redis
import gevent as g
from gevent import sleep
from hashlib import md5
from base64 import b64encode, b64decode
@xmonader
xmonader / gevent_exception_value.py
Last active June 26, 2019 07:48
gevent link exception and value
import gevent as g
from functools import partial
import traceback
def fn(*args, **kwargs):
print("ARGS: ", args)
print("KWARGS: ", kwargs)
g.sleep(3)
return 150
from pynput import keyboard
logs = []
log = ""
def handle_key(key):
global log, logs
try:
log += key.char
print("LOG: ", log)