This file contains hidden or 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 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" | |
| ] | |
This file contains hidden or 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
| 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. |
This file contains hidden or 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
| OPTIMISTIC ROLLBACK | |
| INSERT INTO "Link" ("long_link", "short_link") VALUES (?, ?) | |
| [u't.co', u'3THKS'] | |
| COMMIT | |
| RELEASE_CONNECTION | |
| Traceback (most recent call last): |
This file contains hidden or 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
| 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] |
This file contains hidden or 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 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 |
This file contains hidden or 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 sys | |
| import json | |
| jsonfile = None | |
| if len(sys.argv) == 1: exit() | |
| jsonfile = sys.argv[1] | |
| loaded = None | |
| with open(jsonfile) as f: |
This file contains hidden or 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
| set +ex | |
| if [ ! `which parallel` ] | |
| then | |
| echo "[-] Parallel isn't installed"; | |
| exit 1 | |
| fi | |
| my_ping() { | |
| link=$1 |
This file contains hidden or 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 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 |
This file contains hidden or 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 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 |
This file contains hidden or 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 contextlib import contextmanager | |
| import cProfile, pstats, io | |
| import capnp | |
| from JumpScale import j | |
| import asyncio | |
| import gc | |
| import sys | |
| import importlib | |
| import objgraph |
OlderNewer