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
worker_processes 1; | |
user nobody nogroup; | |
# 'user nobody nobody;' for systems with 'nobody' as a group instead | |
error_log /var/log/nginx/error.log warn; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; # increase if you have lots of clients | |
accept_mutex off; # set to 'on' if nginx worker_processes > 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 requests | |
import json | |
import urllib.parse | |
URL = "http://10.10.10.105/link/" | |
PROXY = "http://10.10.10.105/link/proxy/" | |
class Request(object): |
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
class KaperkarConstant(object): | |
_run = 0 | |
def __init__(self, starting_number): | |
self._starting_n = None | |
self._first_n = None | |
self._second_n = None | |
self._resulting_n = None |
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
project.current_category | |
['add_entry', 'copy', 'cut', 'delete_entry', 'enabled', 'entries', 'move', 'name', 'paste', 'toplevel_entries'] | |
SCRIPT_INFO = {'name': '0'} | |
import sys | |
from time import sleep | |
# if not ui.selection: | |
# ui.error("Nothing selected") |
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
class WrapWithBokeh(object): | |
def __init__(self): | |
self.plot = figure() | |
def __enter__(self): | |
return self.plot | |
def __exit__(self, exc_type, exc_val, exc_tb): | |
output_file = output_file_name | |
show(self.plot) |
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 decorator(func): | |
def wrapper(): | |
plot = figure() | |
func(plot) | |
output_file = output_file_name | |
show(plot) | |
return wrapper | |
@decorator | |
def python_list(plot): |
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
""" | |
Python Parallel Processing (in 60 seconds or less) | |
https://dbader.org/blog/python-parallel-computing-in-60-seconds | |
""" | |
import collections | |
import multiprocessing | |
Scientist = collections.namedtuple('Scientist', [ | |
'name', | |
'born', |
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
""" | |
This module allows you to queue and launch processes using PySide's QProcess | |
""" | |
from PySide.QtCore import QObject, QProcess, Signal, QEventLoop | |
from PySide.QtGui import QApplication | |
class TasksPool(QObject): | |
""" | |
This class allows you to add_task() for execution queue. Launch_list() starts the queue. |
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 PySide import QtGui | |
from PySide.QtCore import QThread, QProcess, Signal, QObject | |
import sys | |
class MainDialog(QtGui.QDialog): | |
def __init__(self): | |
super(MainDialog, self).__init__() | |
self.proc = QProcess() |
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 os import path, makedirs, scandir, listdir, remove, rename | |
from re import search, compile | |
from warnings import warn | |
# ##################################################### CONFIG ####################################################### # | |
conf_default_working_path = '.' | |
conf_default_new_name = 'default_' | |
# #################################################################################################################### # |
NewerOlder