Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
| import bottle | |
| ip = '233.233.233.233' | |
| x = 51.505494 | |
| y = -0.12369 | |
| add = 0.0001 | |
| p1 = (55, 770) | |
| p2 = (55, 820) |
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
| fn horspool<T: Eq+Hash>(haystack: &[T], needle: &[T]) -> isize { | |
| let hlen = haystack.len(); | |
| let nlen = needle.len(); | |
| if nlen == 0 { return 0 } | |
| // jump table | |
| let jmp: HashMap<&T, usize> = needle.iter().zip((1..nlen).rev()).collect(); | |
| let last = nlen - 1; | |
| let mut j = 0; | |
| while j <= hlen - nlen { | |
| // search backward |
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 python3 | |
| import os | |
| import json | |
| import glob | |
| import subprocess | |
| files = glob.glob(os.path.expanduser('~/miniconda3/pkgs/cache/*.json')) | |
| deps = {} | |
| for f in files: | |
| j = json.load(open(f)) |
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 python3 | |
| import asyncio | |
| from vpn import get_proxy | |
| proxy = port = auth = None | |
| pool = asyncio.Queue(5) | |
| psize = 0 | |
| async def process_client(client_reader, client_writer, *, CHUNK=4096): | |
| global psize |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 python3 | |
| import os | |
| import time | |
| import shlex | |
| import bottle | |
| import pprint | |
| import subprocess | |
| from threading import Thread | |
| blue = lambda s: '\033[94m%s\033[0m' % s |
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
| customPandocCompiler :: Compiler (Item String) | |
| customPandocCompiler = | |
| let extraExtensions = | |
| [ Ext_east_asian_line_breaks | |
| , Ext_tex_math_double_backslash | |
| ] | |
| customExtensions = foldr S.insert pandocExtensions extraExtensions | |
| writerOptions = defaultHakyllWriterOptions { | |
| writerExtensions = customExtensions |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| newtype ContT r m a = ContT { runContT :: (a -> m r) -> m r } | |
| instance Functor (ContT r m) where | |
| -- :: (a -> b) -> ContT r m a -> ContT r m b | |
| fmap a2b ca = ContT $ \b2r -> runContT ca (b2r . a2b) | |
| instance Applicative (ContT r m) where | |
| -- :: a -> ContT r m a | |
| pure a = ContT $ \a2r -> a2r a | |
| -- :: ContT r m (a -> b) -> ContT r m a -> ContT r m b |