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
$XONSH_SHOW_TRACEBACK = True | |
$PROJECT_DIRS = g`~/code` + g`~/src` | |
xontrib load vox prompt_ret_code avox z | |
xontrib load schedule salt | |
$PATH = g`~/.conda/bin` + g`~/.local/bin` + list($PATH) | |
${...}.pop('COLUMNS', None) | |
${...}.pop('ROWS', 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
class Top: | |
@property | |
def foo(self): | |
... | |
@foo.setter | |
def set_foo(self, value): | |
... | |
class Spam(Top): | |
@property |
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 time | |
import os | |
import ctypes | |
import ctypes.wintypes | |
PeekNamedPipe = ctypes.windll.kernel32.PeekNamedPipe | |
PeekNamedPipe.restype = ctypes.wintypes.BOOL | |
def try_peek(pipe, desc=''): | |
lpTotalBytesAvail = ctypes.wintypes.DWORD(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
from abc import ABC | |
from collections.abc import Set, Iterable | |
from itertools import count | |
class Base(Iterable, ABC): | |
def __iter__(self): | |
yield from [] | |
def mk(klass): | |
return type('x', (klass,), {})() |
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 django import forms | |
from localflavor.us.forms import USPSSelect | |
class NoDefaultSelect(forms.Select): | |
def render_options(self, selected_choices): | |
opts = super().render_options(selected_choices) | |
if selected_choices: | |
opts = "<option disabled selected value style='display:none;'></option>\n" + opts | |
return opts |
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 ErrorCounter(collections.Counter): | |
""" | |
Repeatable context manager. Counts the types of errors when exiting. | |
Note that expected exceptions are surpressed. | |
Generally, replaces constructs like: | |
for egg in spam(): | |
try: |
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 webview | |
import threading | |
from webview import OPEN_DIALOG, FOLDER_DIALOG, SAVE_DIALOG | |
import asyncio | |
# FIXME: Multiple window support | |
class WebviewThread(threading.Thread): | |
""" | |
Webview as a thread. |
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
#!/bin/sh -e | |
# EC2 | |
#sudo yum install git zlib-devel autoconf automake libtool python35 python35-pip | |
# Scaleway - Ubuntu | |
sudo apt-get install git libpam0g-dev zlib1g-dev dh-autoreconf python3 python3-pip | |
# For some reason, the [ptk] doesn't work on Scaleway C1 with Ubuntu | |
sudo python3 -m pip install xonsh[ptk] | |
git clone https://github.com/shellinabox/shellinabox.git |
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 os.path | |
import sys | |
$PROJECT_DIRS = [os.path.expanduser('~/code'), os.path.expanduser('~/src')] | |
$SHELL_TYPE = 'best' # Work-around for #1561 | |
$XONSH_SHOW_TRACEBACK = True | |
xontrib load prompt_ret_code pacman_tabcomplete vox_tabcomplete vox | |
xontrib load avox z |
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 471024d895e2b2679d2926d6f03528a78b90f8ba Mon Sep 17 00:00:00 2001 | |
From: Jamie Bliss <[email protected]> | |
Date: Thu, 21 Apr 2016 19:02:57 -0400 | |
Subject: [PATCH] Add tip to array syntax error about fixed-width arrays. | |
--- | |
vala/valaarraytype.vala | 2 +- | |
1 file changed, 1 insertion(+), 1 deletion(-) | |
diff --git a/vala/valaarraytype.vala b/vala/valaarraytype.vala |