Skip to content

Instantly share code, notes, and snippets.

@thatch
thatch / gist:878821
Created March 21, 2011 00:22
Diff to diagnose issue 645
diff -r 62c4935c6f63 pygments/util.py
--- a/pygments/util.py Sat Mar 19 20:00:07 2011 -0700
+++ b/pygments/util.py Sun Mar 20 17:22:03 2011 -0700
@@ -120,6 +120,8 @@
return min(1.0, max(0.0, float(rv)))
except ValueError:
return 0.0
+ except TypeError:
+ raise TypeError("Error analyzing %r %r %r" % (f, rv, text))
text_analyse.__doc__ = f.__doc__
@thatch
thatch / gist:880867
Created March 22, 2011 06:48
patch for 635 tb
diff -r 62c4935c6f63 pygments/lexers/asm.py
--- a/pygments/lexers/asm.py Sat Mar 19 20:00:07 2011 -0700
+++ b/pygments/lexers/asm.py Mon Mar 21 23:48:01 2011 -0700
@@ -88,7 +88,10 @@
}
def analyse_text(text):
- return re.match(r'^\.\w+', text, re.M)
+ if re.match(r'^\.(text|data|section)', text, re.M):
+ return True
@thatch
thatch / gist:893801
Created March 30, 2011 03:16
Archlinux oath 1.6.2 update
--- PKGBUILD.orig 2011-03-29 20:13:40.000000000 -0700
+++ PKGBUILD 2011-03-29 20:14:25.000000000 -0700
@@ -1,6 +1,6 @@
# Maintainer: L42y <423300@gmail.com>
pkgname=oath-toolkit
-pkgver=1.4.3
+pkgver=1.6.2
pkgrel=1
pkgdesc="The OATH Toolkit attempts to collect several tools that are useful when deploying technologies related to OATH"
arch=('i686' 'x86_64')
@thatch
thatch / gist:893905
Created March 30, 2011 05:29
Small diff to get pam+docs working in oath-toolkit
--- PKGBUILD 2011-03-29 21:14:15.000000000 -0700
+++ PKGBUILD.mine 2011-03-29 22:28:40.000000000 -0700
@@ -1,7 +1,7 @@
# Maintainer: L42y <423300@gmail.com>
pkgname=oath-toolkit
pkgver=1.6.2
-pkgrel=1
+pkgrel=2
pkgdesc="The OATH Toolkit attempts to collect several tools that are useful when deploying technologies related to OATH"
arch=('i686' 'x86_64')
@thatch
thatch / smali-pkg.diff
Created October 3, 2012 18:26
Update Smali to 1.4.0
--- PKGBUILD.orig 2012-09-19 12:14:53.000000000 -0700
+++ PKGBUILD 2012-09-19 12:15:34.000000000 -0700
@@ -1,7 +1,7 @@
# Maintainer: sh0 <mee@sh0.org>
# Contributor: Lekensteyn <lekensteyn@gmail.com>
pkgname=smali
-pkgver=1.3.3
+pkgver=1.4.0
pkgrel=1
pkgdesc="An assembler/disassembler for Android's dex format"
@thatch
thatch / summarized.txt
Last active December 22, 2018 17:21
Benchmark results for sre_yield issue 10
pat run init x[0] . x[1] . x[-2] . x[-1] . x[:10] . x[-10:] . peak_kb
------------------------------- ------- ----------------- ----------------- ---------------- ---------------- --------------- ---------------- ---------------- ---------------- ---------------- ---------------- --------------- ---------------- ---------------- --------------
[01]{,10} fixed +0.04ms +16.00% +0.00ms +0.00% +0.00ms +0.00% +0.00ms +0.00% +0.00ms +0.00% +0.00ms +0.00% +0.00ms +0.00% +0.00ms +0.00% +0.00ms +0.00% -0.01ms -5.88% +0.00ms +0.00% +0.04ms +8.70% -0.02ms -5.00% -28kB -0.11%
\d+ fixed +0.64ms +7.09% -0.02ms -50.00% -0.01ms -100.00% -0.01ms -33.33% +0.00ms +0.00% -14.25ms -8.08% -0.41ms -
$ find . -name PKG-INFO -print0 | xargs -0 perl -ne 'print "$1\n" if /^License: (.+)/' | sort | uniq -c | sort -n | grep -i apache 1 Apache License
1 dual license GPLv2+ and Apache v2
2 Apache 2
2 APACHE2
2 Apache 2.0.
2 Apache2.0
2 APACHE20
2 Apache 2.0 License: https://www.apache.org/licenses/LICENSE-2.0
2 Apache-2.0 OR MIT
2 Apache 2 license
$ find . -name PKG-INFO -print0 | xargs -0 perl -ne 'print "$1\n" if /^License: (.+)/' | sort | uniq -c | sort -n | grep -i mit
1 http://www.opensource.org/licenses/mit-license.php
1 License :: OSI Approved :: MIT License (http://opensource.org/licenses/MIT)
1 ['MIT', 'BSD']
2 Apache-2.0 OR MIT
2 Copyright 2016 ARM Limited
2 Expat (MIT/X11)
2 LGPL/MIT
2 LICENSE-MIT
2 License :: OSI Approved :: MIT License
find . -name PKG-INFO -print0 | xargs -0 perl -ne 'print "$1\n" if /^License: (.+)/' | sort | uniq -c | sort -n | grep -i ' or '
1 LGPL 2.1 or later
2 Apache-2.0 OR MIT
2 GNU AGPLv3+ or BSD
2 GNU GPLv2 or any later version
2 GPL-2.0-only OR LGPL-2.1-or-later
2 LGPL 2.1 or later, see also http://cthedot.de/cssutils/
2 License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
2 MIT or Apache-2.0
3 MIT or PSF License
diff --git a/libcst/matchers/__init__.py b/libcst/matchers/__init__.py
index df13b71..dc85e16 100644
--- a/libcst/matchers/__init__.py
+++ b/libcst/matchers/__init__.py
@@ -227,12 +227,6 @@ BaseExpressionMatchType = Union[
AnnotationMatchType = Union[
"Annotation", MetadataMatchType, MatchIfTrue[Callable[[cst.Annotation], bool]]
]
-BaseExpressionOrNoneMatchType = Union[
- "BaseExpression",