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
$ echo "pAkH5a9ubW3Etf8SDO548F6ZjuMKNc0I4Cia1lonDv0.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImlzc3VlZF9hdCI6MTM0NzkxMTYxNywicGFnZSI6eyJpZCI6IjI4NzQzNTk4MTM2OTUwNyIsImxpa2VkIjpmYWxzZSwiYWRtaW4iOnRydWV9LCJ1c2VyIjp7ImNvdW50cnkiOiJkZSIsImxvY2FsZSI6ImVuX1VTIiwiYWdlIjp7Im1pbiI6MTMsIm1heCI6MTd9fX0" |cut -d. -f2 |base64 -d |json_pp | |
base64: invalid input | |
{ | |
"algorithm" : "HMAC-SHA256", | |
"page" : { | |
"admin" : true, | |
"liked" : false, | |
"id" : "287435981369507" | |
}, | |
"user" : { |
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
package main | |
import ( | |
"flag" | |
"fmt" | |
"io" | |
"os" | |
"path" | |
"runtime" | |
) |
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
$ pacaur -S --needed bup-git | |
:: Package(s) bup-git not found in repositories, trying AUR... | |
:: pylibacl is available in community | |
:: python2-pyxattr is available in community | |
AUR Targets (1): bup-git | |
Proceed with installation? [Y/n] | |
:: Edit bup-git PKGBUILD? [Y/n] n |
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
BenchmarkStringIndex1First 100000000 20.0 ns/op | |
BenchmarkStringIndex2First 100000000 19.8 ns/op | |
BenchmarkStringIndex1Last 50000000 59.4 ns/op | |
BenchmarkStringIndex2Last 50000000 45.7 ns/op | |
ok indexbench 9.413s |
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
package main | |
import ( | |
"bufio" | |
"flag" | |
"github.com/alecthomas/gozmq" | |
"io" | |
"log" | |
"os" | |
) |
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
#!/usr/bin/env python | |
from __future__ import unicode_literals | |
# Original idea: http://dinaburg.org/bitsquatting.html | |
import gevent.monkey | |
gevent.monkey.patch_all() | |
import dns.name, dns.resolver | |
import gevent, gevent.pool | |
import sys |
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
// Package limitmap provides map of semaphores to limit concurrency against some string keys. | |
// | |
// Usage: | |
// limits := NewLimitMap() | |
// func process(url *url.URL, rch chan *http.Response) { | |
// // At most 2 concurrent requests to each host. | |
// limits.Acquire(url.Host, 2) | |
// defer limits.Release(url.Host) | |
// r, err := http.Get(url.String()) | |
// rch <- r |
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
$ pacaur -S --needed grive-git | |
:: Package(s) grive-git not found in repositories, trying AUR... | |
AUR Targets (1): grive-git | |
Proceed with installation? [Y/n] | |
:: Edit grive-git PKGBUILD? [Y/n] n | |
:: Building grive-git package... | |
==> Determining latest git revision... |
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
diff --git a/eventlet/green/ssl.py b/eventlet/green/ssl.py | |
index 88c47a3..62ab51e 100644 | |
--- a/eventlet/green/ssl.py | |
+++ b/eventlet/green/ssl.py | |
@@ -127,9 +140,11 @@ class GreenSSLSocket(__ssl.SSLSocket): | |
self.__class__) | |
amount = len(data) | |
count = 0 | |
- while (count < amount): | |
+ while count < amount: |
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 inside(): | |
# Good. Consistent. You know up front where to put continuation. | |
# Also consistently short, no matter how long is `xs = itertools.ifilter`. | |
xs = itertools.ifilter(fun, [very_long_name_1, very_long_name_2, | |
very_long_name_3, very_long_name4]) | |
# Bad. Lots of space wasted. Rename 'xs' and you have to reindent everything. | |
xs = itertools.ifilter(fun, | |
[very_long_name_1, very_long_name_2, | |
very_long_name_3, very_long_name_4]) |