Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python3
"""
Usage:
plasmasetconfig # List all widget namespaces
plasmasetconfig org.kde.plasma.digitalclock # List all config groups+keys
plasmasetconfig org.kde.plasma.digitalclock Appearance showSeconds true
Install:
chmod +x ~/Downloads/plasmasetconfig.py
sudo cp ~/Downloads/plasmasetconfig.py /usr/local/bin/plasmasetconfig
Uninstall:
@0xGabi
0xGabi / launch.json
Created October 23, 2021 21:45
VSCode configuration to debug using hardhat in a monorepo
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "hardhat test",
"skipFiles": ["<node_internals>/**"],
"runtimeExecutable": "${workspaceFolder}/packages/hardhat/node_modules/.bin/hardhat",
"args": ["test", "--network", "localhost"],
@xgp
xgp / openapi.yaml
Last active May 10, 2024 04:30
OpenAPI specification for Keycloak account API
openapi: 3.0.2
info:
title: Keycloak Account API
version: 20.0.3
description: |
Derived from the code at https://github.com/keycloak/keycloak/blob/main/services/src/main/java/org/keycloak/services/resources/account/AccountRestService.java
components:
securitySchemes:
access_token:
type: http

Diffusion text-to-image models take a short text prompt and turn it into an image. Here are some prompts I've written that worked well:

{"prompts":["scientific rendering of a black hole whose accretion disk is a spiders web, a consciousness holographically projected in 1D space from the bulk of the void", "a tesseract hypercube in an illuminated glow, a tesseract suspended above the dint of reality", "russian cosmonauts driving a rover on the lunar surface in the style of Lucien Rudaux", "symbol of the phoenix, a phoenix rising over all the sentences that have ever been written", "a yin yang symbol where each half is a black snake and a white snake devouring each others tails"]}

Your task is to write 5 more prompts in the way you infer I'd write them from these examples, but based on a combination of subject, style, and setting. For example:

@baiwfg2
baiwfg2 / CMakeLists.txt
Created September 29, 2018 12:42
How to use add_custom_target and add_custom_command correctly in cmake
# References:
# https://cmake.org/cmake/help/latest/command/add_custom_target.html
# https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/
# https://gist.github.com/socantre/7ee63133a0a3a08f3990
# https://stackoverflow.com/questions/24163778/how-to-add-custom-target-that-depends-on-make-install
# https://stackoverflow.com/questions/30719275/add-custom-command-is-not-generating-a-target
# https://stackoverflow.com/questions/26024235/how-to-call-a-cmake-function-from-add-custom-target-command
# https://blog.csdn.net/gubenpeiyuan/article/details/51096777
cmake_minimum_required(VERSION 3.10)
@MadPonyInteractive
MadPonyInteractive / pyside6_uic.py
Last active May 10, 2024 04:28
PySide6 class to load .ui files to memory like loadUi in PyQt
"""
This code has a YouTube video associated with it
https://www.youtube.com/watch?v=xKIPPZMP9y4&list=PLuvCsqbtUSFAEmez6Tuyi2KitVcS4fLWX&index=5
"""
import subprocess
import xml.etree.ElementTree as xml
class PySide6Ui:
"""
class to load .ui files to memory or
convert them to .py files
@santospatrick
santospatrick / service.js
Created May 18, 2019 21:07 — forked from paulsturgess/service.js
An example Service class wrapper for Axios
import axios from "axios";
class HttpService {
constructor() {
const token = window.localStorage.getItem("token");
const service = axios.create({
baseURL: process.env.REACT_APP_API_URL,
headers: token
? {
Authorization: `Bearer ${token}`,
@sanzoghenzo
sanzoghenzo / compare.py
Last active May 10, 2024 04:25
Compare Excel sheets with Pandas
"""
Compare two Excel sheets
Inspired by https://pbpython.com/excel-diff-pandas-update.html
For the documentation, download this file and type:
python compare.py --help
"""
import argparse
import pandas as pd
@rohit-gohri
rohit-gohri / v8Coverage.js
Created April 13, 2022 04:50
Get runtime coverage from V8 in istanbul format
/* eslint-disable global-require, import/no-extraneous-dependencies, @typescript-eslint/no-use-before-define */
/**
* @see https://github.com/bcoe/c8/issues/376
* @see https://github.com/tapjs/processinfo/blob/33c72e547139630cde35a4126bb4575ad7157065/lib/register-coverage.cjs
*/
if (process.env.V8_COVERAGE) {
process.setSourceMapsEnabled(true);
const inspector = require('inspector');
const session = new inspector.Session();
@VictorTaelin
VictorTaelin / promise_monad.md
Last active May 10, 2024 04:22
async/await is just the do-notation of the Promise monad

async/await is just the do-notation of the Promise monad

CertSimple just wrote a blog post arguing ES2017's async/await was the best thing to happen with JavaScript. I wholeheartedly agree.

In short, one of the (few?) good things about JavaScript used to be how well it handled asynchronous requests. This was mostly thanks to its Scheme-inherited implementation of functions and closures. That, though, was also one of its worst faults, because it led to the "callback hell", an seemingly unavoidable pattern that made highly asynchronous JS code almost unreadable. Many solutions attempted to solve that, but most failed. Promises almost did it, but failed too. Finally, async/await is here and, combined with Promises, it solves the problem for good. On this post, I'll explain why that is the case and trace a link between promises, async/await, the do-notation and monads.

First, let's illustrate the 3 styles by implementing