This file contains 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 annotations | |
from pathlib import Path | |
from colorama import Fore, Style | |
from shutil import make_archive, unpack_archive | |
from contextlib import contextmanager | |
import io | |
import hashlib | |
import sys |
This file contains 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
struct NZList{T} | |
head::T | |
tail::Union{NZList{T},Nothing} | |
end | |
cons(x) = NZList(x, nothing) | |
cons(x::T, xs::Union{NZList{T},Nothing}) where {T} = NZList(x, xs) | |
function Base.iterate(xs::NZList) | |
xs.head, xs.tail |
This file contains 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
const _default_lookup = UInt64[] | |
function sort_required_modules(requires::Vector{Pair{Base.PkgId, Base.PkgId}}, required_modules::Vector{Pair{Base.PkgId, UInt64}}) | |
require_orders = | |
let require_orders = unique!(Base.PkgId[req.second for req in requires]) | |
@view require_orders[1:end] # make 'require_orders' type-stable | |
end | |
require_lookup = Dict{Base.PkgId, Vector{UInt64}}() | |
for (req, build_id) in required_modules |
This file contains 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
using MLStyle: @switch | |
macro forward_def!(self_ann, expr, methods...) | |
@switch self_ann begin | |
@case :($self :: $t_base{$(t_args...)}) | |
@case :($self :: $t_base) && let t_args = [] end | |
end | |
t = if !isempty(t_args) | |
:($t_base{$(t_args...)}) | |
else | |
t_base |
This file contains 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
const commandCreateFile = vscode.commands.registerCommand("extension.dired.createFile", async () => { | |
// list files of provider.dirname | |
const quickPick = vscode.window.createQuickPick(); | |
quickPick.canSelectMany = false; | |
quickPick.placeholder = "Filename:"; | |
let dirname = provider.dirname ?? path.normalize("."); | |
quickPick.items = [{ label: dirname }]; | |
let fileName = quickPick.value; | |
let disposables: vscode.Disposable[] = []; | |
try { |
This file contains 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
var x = new S("x"); | |
var y = new S("y"); | |
var z = new S("z"); | |
var k = new S("k"); | |
y.Dep(z); | |
var xs = new List<S> { k, y, x, z }; | |
var ys = new List<S>(xs); |
This file contains 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
function __ { | |
echo "$@" | |
} | |
function __make_ansi { | |
next=$1; shift | |
echo "\[\e[$(__$next $@)m\]" | |
} | |
function __make_echo { |
This file contains 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
export PYTHONIOENCODING=utf8 | |
# PROMPT_COMMAND="prompt-command" | |
# cache init | |
source activate base | |
if [[ -z "$my_pragma_once" ]]; then | |
source ~/.bashfiles/color.sh # available at https://gist.github.com/thautwarm/d43e17a6c2e48ac7d420281779e9399b | |
source "$(scoop prefix git)\etc\profile.d\git-prompt.sh" | |
source /usr/share/bash-completion/bash_completion | |
export PATH=$HOME/scoop/shims:$PATH |
This file contains 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 wisepy2 import wise | |
def main(filename: str): | |
"""return a pair: | |
- non-empty character count | |
- non-empty line count | |
""" | |
l = 0 | |
c = 0 | |
for line in open(filename, 'r', encoding='utf8'): |
This file contains 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
[[293, 346], [293, 343], [288, 339], [276, 351], [293, 346]] (0, 20, 28) | |
[[353, 342], [347, 329], [346, 328], [341, 330], [339, 331], [344, 340], [353, 342]] (0, 20, 28) | |
[[354, 327], [350, 327], [347, 329], [353, 342], [354, 342], [359, 342], [359, 330], [354, 327]] (0, 20, 28) | |
[[381, 341], [366, 324], [364, 325], [360, 327], [359, 330], [359, 342], [365, 344], [381, 341]] (0, 20, 28) | |
[[381, 341], [385, 341], [371, 321], [370, 321], [367, 324], [366, 324], [381, 341]] (0, 20, 28) | |
[[405, 315], [400, 312], [392, 316], [388, 321], [392, 341], [411, 350], [405, 315]] (0, 20, 28) | |
[[313, 314], [316, 311], [312, 308], [308, 311], [309, 313], [310, 314], [313, 314]] (0, 20, 28) | |
[[320, 307], [314, 302], [312, 305], [312, 308], [316, 311], [317, 311], [320, 309], [320, 307]] (0, 20, 28) | |
[[312, 305], [308, 304], [304, 307], [304, 307], [305, 309], [308, 311], [312, 308], [312, 305]] (0, 20, 28) | |
[[395, 310], [394, 310], [392, 316], [400, 312], [399, 311], [395, 310]] (0, 20, 28) |
NewerOlder