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
from getopt import getopt
from optparse import OptionParser
from argparse import ArgumentParser
cmds=["flask -c users", "flask --controller users", "flask --controller=users",
"flask -m post", "flask --model post", "flask --model=post",
"flask -v", "flask --version"
]
octave:1> s=tf('s');
octave:2> G=(s+1)/(0.1*s+1)
Transfer function 'G' from input 'u1' to output ...
s + 1
y1: ---------
0.1 s + 1
Continuous-time model.
OPTIMISTIC ROLLBACK
INSERT INTO "Link" ("long_link", "short_link") VALUES (?, ?)
[u't.co', u'3THKS']
COMMIT
RELEASE_CONNECTION
Traceback (most recent call last):
def shortlink_exists(s):
ls=select(p for p in Link if p.short_link==s)[:]
if ls:
return ls[0]
def longlink_exists(link):
ls= select(p for p in Link if p.long_link==link)[:]
if ls:
return ls[0]
import json
loaded = None
with open("/opt/myjs8xenialopt/out.json") as f:
loaded = json.load(f)
def generate_class(info, level): #name, type, doc
name, t, doc, objpath, filepath, extra = info
#we got all the subclasses of this one
#and foreach subclass we generate its template based on indenetation level as well
import sys
import json
jsonfile = None
if len(sys.argv) == 1: exit()
jsonfile = sys.argv[1]
loaded = None
with open(jsonfile) as f:
@xmonader
xmonader / linkschecker.sh
Created November 14, 2016 14:20
parallel links checker
set +ex
if [ ! `which parallel` ]
then
echo "[-] Parallel isn't installed";
exit 1
fi
my_ping() {
link=$1
import re
def gt_reg_gen(num):
s_num = str(num)
first = int(s_num[0])+1
pat = "([{first}-9]\d+)|".format(**locals())
slen = len(s_num)
for idx, sn in enumerate(s_num):
n = int(sn)
nplus = n+1
from functools import *
# def printandreturn(left, right):
# seen, lastres = left
# if lastres == False:
# return seen, False
# if seen[0] == right:
# return seen, True
# return seen, len(seen)<2 is True
from contextlib import contextmanager
import cProfile, pstats, io
import capnp
from JumpScale import j
import asyncio
import gc
import sys
import importlib
import objgraph