Skip to content

Instantly share code, notes, and snippets.

View main_view.enaml
import os
from enaml.image import Image
from enaml.widgets.api import Action, Container, ImageView, Label, MainWindow, Menu, MenuBar, StatusBar, StatusItem, FileDialogEx
enamldef MainWindow(MainWindow): window:
title << 'Image Viewer - %s' % os.path.basename(folder.path) if folder.path else 'Image Viewer'
attr folder
View folder_model.py
import os
import magic
from atom.api import Atom, Bytes, Int, List, Str, observe
from enaml.image import Image
# https://pypi.org/project/natsort/
from natsort import natsorted
class ImageFolder(Atom):
View image_viewer.py
import argparse
import os
import enaml
from enaml.qt.qt_application import QtApplication
from enaml.widgets.api import Action
from folder_model import ImageFolder
argument_parser = argparse.ArgumentParser()
View ungoogled-chromium-extension-updater.py
import argparse
import json
import os
import posixpath
import shutil
import subprocess
import tempfile
import requests
View glassbox
#!/usr/bin/env python
import argparse
import collections
import itertools
import os
import shlex
import stat
import subprocess
import sys
View IPFS.py
import argparse
import collections
import itertools
import os
import sys
import time
try:
import cPickle as pickle
View on-reachable
#!/usr/bin/env python
import argparse
import shlex
import subprocess
import time
argument_parser = argparse.ArgumentParser()
argument_parser.add_argument('ip')
argument_parser.add_argument('--on-reachable', action='append', default=[])
View bus-path-by-name.py
import argparse
import re
import subprocess
argument_parser = argparse.ArgumentParser()
argument_parser.add_argument('name')
LSUSB_PATTERN = re.compile(
r'Bus (?P<bus>\d{3}) Device (?P<device>\d{3}): ID (?P<id>[a-z0-9]{4}:[a-z0-9]{4}) (?P<name>.*)')
View predicates.py
# Here's a regular example of a predicate using numbers:
def my_predicate(item):
return item > 5
items = [5, 10, 6, 7, 7, -2]
for filtered in filter(my_predicate, items):
print(filtered)
# Output: 10, 6, 7, 7
View qute-pass
#!/usr/bin/env python
# Dependencies: python-tldextract, pass
import argparse
import enum
import fnmatch
import functools
import os
import re
You can’t perform that action at this time.