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
const http2 = require("http2"); | |
const fs = require("fs"); | |
const port = 8433; | |
const server = http2.createSecureServer({ | |
key: fs.readFileSync("localhost.key"), | |
cert: fs.readFileSync("localhost.crt"), | |
}); |
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 sys | |
from typing import Optional | |
from beancount.ingest import importer | |
sys.path.append("./") | |
import csv | |
from datetime import datetime | |
from datetime import timedelta | |
from beancount.core import data |
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 csv | |
import re | |
from collections import namedtuple | |
from datetime import date | |
from datetime import datetime | |
from datetime import timedelta | |
from typing import List | |
from beancount.core import data | |
from beancount.core.amount import 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
outputs=[] | |
with open('graphene_plugin.test', 'r') as f: | |
for x in f.read().strip().splitlines(): | |
if x.startswith("[case "): | |
outputs.append(f"- case: {x.replace('[case', '').replace(']', '').strip()}") | |
outputs.append(" main: |") | |
elif x == "[out]": | |
outputs.append(" out: |") | |
else: | |
outputs.append(f" {x}") |
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
{ | |
"a": "a\b" | |
} |
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
''.join([x for x in s if x.isprintable()]) |
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 shutil | |
import sys | |
from pathlib import Path | |
def handle_path(path: Path): | |
subfolders = [] | |
seen_sdrs = set() |
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
yarn config set puppeteer_download_host https://npm.taobao.org/mirrors |
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
#!/bin/bash | |
clean_sdr_in_current_folder () { | |
find . -maxdepth 1 ! -path . -type d -print0 | while read -d $'\0' FOLDER | |
do | |
FOLDER=$(basename "$FOLDER") | |
if [[ $FOLDER == *".sdr" ]]; then | |
if [ -d "$FOLDER" -a ! -n "$(find . -maxdepth 1 -type f -name "${FOLDER%.sdr}*" -print -quit)" ] | |
then | |
echo "Remove $FOLDER" |
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
Get-ChildItem -Path 'D:\PATH' -Filter *pptx -Recurse | | |
ForEach-Object -Begin { | |
$null = Add-Type -AssemblyName Microsoft.Office.Interop.powerpoint | |
$SaveOption = [Microsoft.Office.Interop.PowerPoint.PpSaveAsFileType]::ppSaveAsPDF | |
$PowerPoint = New-Object -ComObject "PowerPoint.Application" | |
} -Process { | |
$Presentation = $PowerPoint.Presentations.Open($_.FullName) | |
$PdfNewName = $_.FullName -replace '\.pptx$','.pdf' | |
$presentation.SaveAs($PdfNewName,$SaveOption) | |
$presentation.close() |
NewerOlder