This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
⚠️ It does not prompt or ask permission. It just deletes all the snippets! | |
usage: node osx-snippet-delete.js | |
*/ | |
const path = require("path"); | |
const {exec} =require("child_process") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# tell electron packager's rcedit.exe to use wine64 | |
export WINE=`which wine64` | |
export WINEARCH=win64 | |
export WINE_ARCH=win64 | |
# possibly interesting information | |
# https://wiki.winehq.org/Debug_Channels | |
# unset WINEDEBUG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
function displayCategories(parent = undefined) { // start with no parent | |
site.categories | |
.find({ parent }) // warehouse allows for complex queries | |
.sort("name") // sorting .sort("fieldName", 1) ascending or .sort("fieldName", -1) descending | |
.each(function(category) { | |
// count the child categories | |
const childCount = site.categories.find({ parent: category._id }).count(); | |
%> | |
<li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { writable, get } = require("svelte/store"); | |
const merge = require("lodash/merge"); | |
/** | |
* A svelte store writable with two extra methods | |
* | |
* Usage: | |
* const store = customStore({ name: "Erasmus" }); | |
* store.merge({ name: "Billy" }); | |
* store.reset(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
1. by default express is using etags caching which may not be preferable | |
2. add nocache middleware | |
3. disable etags for server | |
4. disable etags and last modified for static files middleware | |
*/ | |
const express = require("express"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
browser-sync start -w --ss dist --port 9924 --host 127.0.0.1 --logLevel error --no-notify --no-open --no-ui --no-online --no-ghost-mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm config set -g send-metrics false | |
npm config set -g metrics-registry "http://127.0.0.1:11923" | |
npm config set -g ham-it-up false | |
npm config set -g optional false | |
npm config set -g loglevel error | |
npm config set -g init-version "0.1.0" | |
npm config set -g init-license "UNLICENSED" | |
npm config set -g init-author-url "" | |
npm config set -g init-author-email "" | |
npm config set -g init-author-name "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This approach works. ✅ | |
# The idea is possibly cURL is tolerant to invalid headers. | |
# How to test: | |
# 1. Install cURL https://curl.haxx.se/ | |
# 2. In your terminal copy and paste: | |
curl -v -H 'X-TOKEN: 1234' 'https://cloudpanel-api.ionos.com/v1/servers' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# | |
# Obliterate systemd service | |
# https://superuser.com/questions/513159/how-to-remove-systemd-services#936976 | |
# | |
systemctl stop $1 2>/dev/null || true | |
systemctl stop $1.service 2>/dev/null || true | |
systemctl disable $1 2>/dev/null || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# svelte language-specific tab trigger | |
# NOT source.js scope -------------------------------v | |
'atom-text-editor[data-grammar="source svelte"]:not(.source.js)': | |
'tab': 'emmet:expand-abbreviation-with-tab' |