Skip to content

Instantly share code, notes, and snippets.

@qoomon
qoomon / conventional_commit_messages.md
Last active April 16, 2024 18:54
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* Workaround example on how to inject and execute arbitrary bytecode in solidity contract
* Currently only YUL supports verbatim: https://github.com/ethereum/solidity/issues/12067
* But you cannot import Solidity code in YUL, or YUL code in solidity, so this workaround is necessary.
* It works as long the byte sequence `7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E7E` appear once in the runtime code.
*
* Example: ADD two numbers.
@jaman
jaman / LiveViewPlaygroundInDocker.livemd
Created March 25, 2024 14:13
Quickly getting livebook to host a liveview server in a docker container.

LIveViewPlayground in Docker

Mix.install([
  {:liveview_playground, "~> 0.1.1"}
])

Section

@eklex
eklex / 80-mount-usb-to-media-by-label.rules
Last active April 16, 2024 18:49
udev rule for Home Assistant OS (hassio) to mount USB drives into the Supervisor Media directory
#
# udev rule
# Mount USB drive to the media directory using the partition name as mount point
#
# Description:
# Created for Home Assistant OS, this rule mounts any USB drives
# into the Hassio media directory (/mnt/data/supervisor/media).
# When a USB drive is connected to the board, the rule creates one directory
# per partition under the media directory. The newly created partition is named
# as the partition name. If the partition does not have a name, then the following
@redhajuanda
redhajuanda / README.md
Created February 4, 2020 10:13
Execute golang service with node pm2

Run the service with pm2

pm2 start package.json

@Jimmy-Z
Jimmy-Z / pve-cloud-init-template-debian.sh
Last active April 16, 2024 18:47
create a Debian VM template for Proxmox VE
#!/bin/sh
# apt install curl
# obviously change this per your needs
VMID=9001
STOR=local-lvm
VER=20230124-1270
URL_PATH=https://cloud.debian.org/images/cloud/bullseye/$VER/
IMG=debian-11-genericcloud-amd64-$VER.qcow2
@kepano
kepano / obsidian-web-clipper.js
Last active April 16, 2024 18:44
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@Klerith
Klerith / batman-quotes.js
Created June 16, 2021 23:02
Quotes de Batman
const quotes = [
{ quote: 'The night is darkest just before the dawn. And I promise you, the dawn is coming.', author: 'Harvey Dent, The Dark Knight' },
{ quote: 'I believe what doesn’t kill you simply makes you, stranger.', author: 'The Joker, The Dark Knight' },
{ quote: 'Your anger gives you great power. But if you let it, it will destroy you… As it almost did me', author: 'Henri Ducard, Batman Begins' },
{ quote: 'You either die a hero or live long enough to see yourself become the villain.', author: 'Harvey Dent, The Dark Knight' },
{ quote: 'If you’re good at something, never do it for free.', author: 'The Joker, The Dark Knight' },
{ quote: 'Yes, father. I shall become a bat.', author: 'Bruce Wayne/Batman, Batman: Year One' },
]
@oevans
oevans / AGO_PullHostedFeatures.py
Last active April 16, 2024 18:37
Python script to pull hosted features with attachments into a local file geodatabase. See ReadMe below.
import os, urllib, urllib2, datetime, arcpy, json
## ============================================================================== ##
## function to update a field - basically converts longs to dates for date fields ##
## since json has dates as a long (milliseconds since unix epoch) and geodb wants ##
## a proper date, not a long.
## ============================================================================== ##
def updateValue(row,field_to_update,value):
outputfield=next((f for f in fields if f.name ==field_to_update),None) #find the output field
@Cortexelus
Cortexelus / udio.py
Last active April 16, 2024 18:36
Automate Udio (2024-04-13)
# AUTOMATE UDIO
# by DADABOTS dadabots.com
# was working on 2024-04-13
# tldr; get your login cookie, use it to automate udio from python
import requests
import json
from time import sleep
import re