Skip to content

Instantly share code, notes, and snippets.

rofi usage:
rofi [-options ...]
Command line only options:
-no-config Do not load configuration, use default values.
-v,-version Print the version number and exit.
-dmenu Start in dmenu mode.
-display [string] X server to contact.
${DISPLAY}
-h,-help This help message.
docopt breaks:
-o=<folder-path>, location of the output folder, by default `_build` in
--output-folder=<folder-path> the current working folder
this scrolls off the screen for all the options if we are lining up columns
-o=<folder-path>, --output-folder=<folder-path> location of the output folder, by default `_build` in
the current working folder
from timeit import Timer
# ........................................................................... #
FORBIDDEN_CHARS = \
('!',
'@',
'#',
'$',
'%',
from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
from rest_toolkit import resource
@resource('/')
class Greeting(object):
def __init__(self, request):
pass
Copying src/zope.interface.egg-info to build/bdist.linux-x86_64/wheel/zope.interface-4.1.3-py3.5.egg-info
Installing build/bdist.linux-x86_64/wheel/zope.interface-4.1.3-py3.5-nspkg.pth
running install_scripts
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-ctv9n1fs/zope.interface/setup.py", line 147, in <module>
**extra)
File "/usr/lib64/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib64/python3.5/distutils/dist.py", line 955, in run_commands
class Engine(object):
def __init__(self, size):
self.size = size
def turn_on(self):
print "vrooom"
class BiggerEngine(object):
def __init__(self, size):
@goodwillcoding
goodwillcoding / default.nix
Created August 25, 2015 00:12
nix custom packages passthru
{ system ? builtins.currentSystem, foo ? "hello" }:
let
pkgs = import <nixpkgs> { inherit system; };
callPackage = pkgs.lib.callPackageWith (pkgs // self // { foo = foo;} );
self = rec {
myPackage = callPackage ./pkgs/my_package {
some_argument = foo;
};
};
@goodwillcoding
goodwillcoding / compile_patch.diff
Last active January 15, 2019 03:24
Patch to send compile to remote machine if Linux arch does match
diff --git a/nixops/backends/__init__.py b/nixops/backends/__init__.py
index 86ed0f4..c52e9d3 100644
--- a/nixops/backends/__init__.py
+++ b/nixops/backends/__init__.py
@@ -93,6 +93,17 @@ class MachineState(nixops.resources.ResourceState):
except nixops.ssh_util.SSHCommandFailed:
return None
+ def get_os_arch(self):
+ """Get the machine's OS archicture."""
class NoRequestParamsPredicate(object):
def __init__(self, val, config):
self.val = bool(val)
def text(self):
return 'no_request_params = %s' % self.val
phash = text
def __call__(self, context, request):
class ExactRequestParamPredicate(object):
def __init__(self, val, config):
val = _as_sorted_tuple(val)
reqs = []
for p in val:
k = p
v = None
if '=' in p:
k, v = p.split('=', 1)
k, v = k.strip(), v.strip()