- https://github.com/zyedidia/micro/blob/master/runtime/help/defaultkeys.md
- https://github.com/zyedidia/micro/blob/master/runtime/help/commands.md
- https://github.com/zyedidia/micro/blob/master/runtime/help/keybindings.md
Ctrl+E to open command panel
| function parse_json_date(json_date) | |
| local pattern = "(%d+)%-(%d+)%-(%d+)%a(%d+)%:(%d+)%:([%d%.]+)([Z%+%-])(%d?%d?)%:?(%d?%d?)" | |
| local year, month, day, hour, minute, | |
| seconds, offsetsign, offsethour, offsetmin = json_date:match(pattern) | |
| local timestamp = os.time{year = year, month = month, | |
| day = day, hour = hour, min = minute, sec = seconds} | |
| local offset = 0 | |
| if offsetsign ~= 'Z' then | |
| offset = tonumber(offsethour) * 60 + tonumber(offsetmin) | |
| if xoffset == "-" then offset = offset * -1 end |
Let's say contributor has submitted a pull request to your (author) project (repo). They have made changes on their
branch feature and have proposed to merge this into origin/master, where
origin -> https://github.com/author/repo.gitNow say you would like to make commits to their PR and push those changes. First, add their fork as a remote called
| <div id="my-unique-id" hx-history-preserve> | |
| <p>Markup here wil be returned to it's original state on history restore.</p> | |
| </div> |
| htmx.on('htmx:beforeSwap', (htmxEvent) => { | |
| let incomingDOM = new DOMParser().parseFromString(htmxEvent.detail.xhr.response, "text/html"); | |
| // Transpose <meta> data, page-specific <link> tags and JSON-LD structured data | |
| // Note that hx-boost automatically swaps the <title> tag | |
| let selector = "head > meta:not([data-revision]), head *[rel=\"canonical\"], head *[rel=\"alternate\"], body script[type=\"application/ld+json\"]"; | |
| document.querySelectorAll(selector).forEach((e) => { | |
| e.parentNode.removeChild(e); | |
| }); | |
| incomingDOM.querySelectorAll(selector).forEach((e) => { | |
| if (e.tagName === 'SCRIPT') { |
| from threading import Timer | |
| def debounce(wait): | |
| """ Decorator that will postpone a functions | |
| execution until after wait seconds | |
| have elapsed since the last time it was invoked. """ | |
| def decorator(fn): | |
| def debounced(*args, **kwargs): | |
| def call_it(): |
This is a cross post of something I just posted on the Python bug tracker at https://bugs.python.org/msg373145.
I seem to have two cents to offer so here it is. An obscure issue in the Python bug tracker is probably not the right place for this so consider this as an early draft of something that maybe I'll talk about more elsewhere.
> This basically divides code into two islands - async and non-async
| #!/usr/bin/env python | |
| # | |
| # Copyright 2001-2002 by Vinay Sajip. All Rights Reserved. | |
| # | |
| # Permission to use, copy, modify, and distribute this software and its | |
| # documentation for any purpose and without fee is hereby granted, | |
| # provided that the above copyright notice appear in all copies and that | |
| # both that copyright notice and this permission notice appear in | |
| # supporting documentation, and that the name of Vinay Sajip | |
| # not be used in advertising or publicity pertaining to distribution |
| package dk.im2b | |
| import java.io.OutputStream | |
| import java.net.ServerSocket | |
| import java.net.Socket | |
| import java.nio.charset.Charset | |
| import java.util.* | |
| import kotlin.concurrent.thread | |
| aahed | |
| aalii | |
| aargh | |
| aarti | |
| abaca | |
| abaci | |
| abacs | |
| abaft | |
| abaka | |
| abamp |