This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import json | |
import sys | |
import yaml | |
class Device: | |
def __init__(self, device_id, adapter, *args): | |
self.device_id = device_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface Paginator { | |
getPageDatas(page: number): Promise<any[]>; | |
getNbPages(): Promise<number>; | |
getNbRowsPerPage(): Promise<number>; | |
} | |
import { Paginator } from "./paginator.interface"; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Observable, Subject } from 'rxjs'; | |
export class CacheEntryOptions { | |
expire?: number; | |
updateIf?: Function; | |
} | |
export class CacheEntry<T> { | |
private value: T; | |
private context: any; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Run current file", | |
"type": "node", | |
"request": "launch", | |
"program": "${file}", | |
"stopOnEntry": false, | |
"args": [], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from importlib.machinery import PathFinder | |
import os | |
import sys | |
class PrefixedPathFinder: | |
pathes = { | |
"modload.plugins" : os.path.join(os.path.abspath(os.path.dirname(__file__))) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Timer = function (finalDate, onRefresh) { | |
var SECOND = 1000, | |
MINUTE = 60 * SECOND, | |
HOUR = 60 * MINUTE, | |
DAY = 24 * HOUR; | |
function getDelta(delta) { | |
var obj = {}; | |
obj.days = parseInt(delta / DAY, 10); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse, copy, json, logging, os, sys | |
class TaggModule: | |
def __init__(self, path): | |
self.path = path | |
self.name = None | |
self.version = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.http import HttpResponseNotAllowed | |
HTTP_METHODS_11 = ['HEAD', 'GET', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'TRACE'] | |
class HttpView: | |
_http_methods = list(HTTP_METHODS_11) | |
def methods_available(self): | |
methods = getattr(self, '_http_methods_available', None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Event(object): | |
def __init__(self): | |
self.callables = {} | |
def on(self, func, uid=None): | |
if not callable(func): | |
raise TypeError("callable required") | |
if not uid: | |
uid = str(hash(func)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream django { | |
## uwsgi launcher example: uwsgi --socket mysite.sock --module mysite.wsgi --chmod-socket=666 | |
server unix:///path/to/mysite.sock; | |
} | |
server { | |
listen 8080 default_server; |
NewerOlder