Skip to content

Instantly share code, notes, and snippets.

def is_surrogate(string):
for index, char in enumerate(string):
if 0xD800 <= ord(char) <= 0xDBFF:
try:
next_char = string[index + 1]
except IndexError:
pass
if 0xDC00 <= ord(next_char) <= 0xDFFF:
return True
else:
package main
type S struct {
Inner int
}
func main() {
foo()
}
package main
import (
"context"
"fmt"
"time"
"eleme/nex/db"
"eleme/nex/log"
"eleme/nex/utils"
function replaceAllLink() {
var ruleMap = new Map(
[
["link.zhihu.com/?target=", [
"http://link.zhihu.com/?target=",
"https://link.zhihu.com/?target="
]]
]
)
In [5]: ---------------------------------------------------------------------------
timeout Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/thriftpy_cli/cmd.pyc in <module>()
----> 1 client.sync_user_data([calc_thrift.User(pass_id=12345678, phone='17600396522')])
/usr/local/lib/python2.7/site-packages/thriftpy/thrift.pyc in _req(self, _api, *args, **kwargs)
196 # wait result only if non-oneway
197 if not getattr(result_cls, "oneway"):
--> 198 return self._recv(_api)
199
class KubernetesHelm < Formula
desc "The Kubernetes package manager"
homepage "https://helm.sh/"
url "https://github.com/kubernetes/helm.git",
:tag => "v2.9.1",
:revision => "20adb27c7c5868466912eebdf6664e7390ebe710"
head "https://github.com/kubernetes/helm.git"
bottle do
cellar :any_skip_relocation
def foo():
a = 1
def bar():
a += 1
return a
return bar
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import asyncio
async def sleep():
print('start')
try:
await asyncio.sleep(100)
except:
print('canceld')
@ethe
ethe / test.py
Last active August 13, 2019 11:10
from multiprocessing import Pool
import requests
def process_url(url):
print('start')
requests.get(url)
print('done')
return