Skip to content

Instantly share code, notes, and snippets.

@KlfJoat
KlfJoat / titleUrlMarkdownClip.js
Last active February 21, 2024 00:27 — forked from idelem/titleUrlMarkdownClip.js
Bookmarklet to copy current page title and url in Markdown format to clipboard, like [title](url) - Usual for posting links to resources in README.md files
javascript:(function() {
function copyToClipboard(text) {
if (window.clipboardData && window.clipboardData.setData) {
/*IE specific code path to prevent textarea being shown while dialog is visible.*/
return clipboardData.setData("Text", text);
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
var textarea = document.createElement("textarea");
textarea.textContent = text;
@KlfJoat
KlfJoat / GitHub-Forking.md
Created January 3, 2024 01:13 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@KlfJoat
KlfJoat / mdns.sh
Last active July 27, 2022 22:53 — forked from 3isenHeiM/MDNS_jail_FreeNAS
Enable MDNS on a FreeNAS/BSD jail. That will allow a Avahi name resolution of the jail in the local network.
#!/bin/sh
# This script is to be executed on the FreeNAS/BSD host itself (and not inside the jail)
# Warning: The proper space-delimited interface(s) must be passed in mdnsd_flags or it will not work.
# usage : ./mnds.sh <jail name or jid>
pkg -j ${1} install --yes openmdns
sysrc -j ${1} mdnsd_enable=yes
#IFACE=$(jexec -l ${1} ifconfig | grep epair | head -n 1 | cut -f1 -d:) # This assumes different networking than I use.
IFACE=$(ifconfig -l -u | sed -e 's/[[:space:]]lo.[[:space:]]*//g') # Why use 3 pipes when the base command will format it for you?
sysrc -j ${1} mdnsd_flags="${IFACE}"
NAME=project
VERSION=0.0.1
DIRS=etc lib bin sbin share
INSTALL_DIRS=`find $(DIRS) -type d 2>/dev/null`
INSTALL_FILES=`find $(DIRS) -type f 2>/dev/null`
DOC_FILES=*.md *.txt
PKG_DIR=pkg
PKG_NAME=$(NAME)-$(VERSION)