In iTerm2, in the menu bar go to Scripts > Manage > New Python Script
Select Basic. Select Long-Running Daemon
Give the script a decent name (I chose auto_dark_mode.py)
Save and open the script in your editor of choice.
| # build gcc toolchain targeting x86_64-linux-musl with https://github.com/richfelker/musl-cross-make | |
| # don't use master branch which uses musl v1.2.1(the new malloc implementation has deadlock problems, v1.2.2 fixes it, v1.2.0 doesn't have it) | |
| cd ~ | |
| git clone https://github.com/richfelker/musl-cross-make -b v0.9.9 | |
| cd musl-cross-make | |
| cp config.mak.dist config.mak | |
| # edit config.mak: TARGET = x86_64-linux-musl | |
| # edit cowpatch.sh to fix an error, add "OPTIND=1" after line 56. see https://github.com/richfelker/musl-cross-make/issues/86 | |
| # ensure you have g++, on fedora it's "dnf install gcc-c++" | |
| make -j`nproc` |
| import java.io._ | |
| import java.util.zip.ZipInputStream | |
| import geny.Generator | |
| import mill._ | |
| import mill.define.Target | |
| import mill.scalajslib._ | |
| object WebpackLib { |
| [ | |
| { | |
| "name" : "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl", | |
| "allDeclaredConstructors" : true, | |
| "allPublicConstructors" : true, | |
| "allDeclaredMethods" : true, | |
| "allPublicMethods" : true, | |
| "allDeclaredClasses" : true, | |
| "allPublicClasses" : true | |
| } |
| import java.io.{ByteArrayOutputStream, PrintWriter} | |
| import java.util.spi.ToolProvider | |
| enablePlugins(JavaAppPackaging) | |
| //this allows us to run tools like jdeps and jlink from within the JVM | |
| def runTool(name: String, arguments: Seq[String]): Either[String,String] = { | |
| val maybeTool: Option[ToolProvider] = { | |
| val _tool = ToolProvider.findFirst(name) | |
| if(_tool.isPresent) { |
Update: As of 11 January 2022, git.io no longer accepts new URLs.
Command:
curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"URLs that can be created is from:
https://github.com/*https://*.github.com| import java.io._ | |
| object A | |
| { | |
| /* | |
| * Starts two concurrent threads that acquire file locks in a timed manner. | |
| * Arguments: | |
| * initialDelayA(ms) lockTimeA(ms) lockFileA initialDelayB(ms) lockTimeB(ms) lockFileB | |
| * | |
| * Example usage: demonstrates "Resource deadlock avoided" when there is no actual deadlock. |