Install Jupyter extension (vs code)
Install ipykernel Install notebook
| import type { Root, Heading } from "mdast"; | |
| import rehypeParse from "rehype-parse"; | |
| import rehypeRemark from "rehype-remark"; | |
| import remarkStringify from "remark-stringify"; | |
| import { unified } from "unified"; | |
| function extractMDSection({ section }: { section?: RegExp }) { | |
| return (tree: Root) => { | |
| const headingIdx = tree.children.findIndex((node) => { | |
| return ( |
| { | |
| "environment": "development", | |
| "event_id": "ba0b3ec25fc24945b25f8e8cfdb9ca7a", | |
| "platform": "python", | |
| "profile": { | |
| "frames": [ | |
| { | |
| "abs_path": "/home/byk/Projects/spotlight-django/.venv/lib/python3.12/site-packages/django/template/loaders/filesystem.py", | |
| "module": "django.template.loaders.filesystem", | |
| "filename": "django/template/loaders/filesystem.py", |
| let locks = []; | |
| const fn = async () => { | |
| let resolve; | |
| locks.push(new Promise(r => (resolve=r))); | |
| let lock; | |
| while (locks.length > 1 && (lock = locks.shift())) | |
| await lock; | |
| console.log(new Date()); | |
| setTimeout(resolve, 1000); |
| # Blogger's backup file to WordPress' WXR converter. | |
| # | |
| # Only tested with posts and comments, and NOT with pages. | |
| # May not be efficient for huge blogs since the script keep | |
| # all content in the memory during conversion. | |
| # | |
| # Released as public domain. | |
| # | |
| # Please note that I converted the labels in Blogspot | |
| # as tags in WordPress. I also hardcoded two categories for the |
I hereby claim:
To claim this, I am signing this object:
| <?php | |
| /** | |
| * Escapes a single argument to be glued together and passed into | |
| * CreateProcess on Windows through `proc_open`. | |
| * | |
| * Adapted from https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/ | |
| * | |
| * @param string The argument to be escaped | |
| * @result string Escaped argument that can be used in a CreateProcess call | |
| */ |
| ''' | |
| This file is based on the code from https://github.com/JustAMan/pyWinClobber/blob/master/win32elevate.py | |
| Copyright (c) 2013 by JustAMan at GitHub | |
| Permission is hereby granted, free of charge, to any person obtaining a copy of | |
| this software and associated documentation files (the "Software"), to deal in | |
| the Software without restriction, including without limitation the rights to | |
| use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
| the Software, and to permit persons to whom the Software is furnished to do so, |
| import itertools | |
| import operator | |
| get_branches = lambda: [branch[1:].strip() for branch in $(git branch --list).split('\n') if branch] | |
| get_remotes = lambda: dict((k, set(v[1] for v in group)) for k, group in itertools.groupby(branch.split('->')[0].split('/') for branch in $(git branch -r).split(), operator.itemgetter(0)) if k) |
| class SudokuSolver(object): | |
| def __init__(self, n=3): | |
| self.n = n | |
| self.size = self.n * self.n | |
| self.matrix = [ | |
| [set(range(1, self.size+1)) for i in range(self.size)] for | |
| j in range(self.size) | |
| ] | |
| def show(self): |