Skip to content

Instantly share code, notes, and snippets.

@keilmillerjr
keilmillerjr / Creating an AUR Package.md
Last active April 23, 2024 22:36
How to create and manage an AUR package. #AUR #ARCH #makepkg #PKGBUILD
@sylumer
sylumer / shortcuts_from_drafts.js
Created December 31, 2022 19:25
Functions for calling Shortcuts on the Mac via a shell command
// Run a shortcut and return the result
function shortcutRun(p_strShortcutName, p_strShortcutInput)
{
// Define the script to run
let objShell = ShellScript.create(`#!/bin/zsh
echo "${p_strShortcutInput}" | shortcuts run "${p_strShortcutName}" | tee`);
// Run the script and return the result or write out any error to the log.
if (objShell.execute()) return objShell.standardOutput;
else
@sylumer
sylumer / control.json
Last active April 23, 2024 22:34
Demo JSON for a Shortcut Control
{
"first_action" :
{
"name" : "Say Hello",
"version" : "2",
"install_url": "https://www.icloud.com/shortcuts/a1f7d39b7b1a4a8b982478457ce1d8fb"
},
"last_action" :
{
"name" : "Say Bonjour",
@sylumer
sylumer / daily-timeline.html
Last active April 23, 2024 22:33
Obsidian Annual Timeline
<html>
<body>
<script>
function isLeapYear(p_intYear)
{
return (p_intYear % 100 === 0) ? (p_intYear % 400 === 0) : (p_intYear % 4 === 0);
}
function writeYear(p_intYear)
@Velocet
Velocet / Unlock-PowerCfg.ps1
Last active April 23, 2024 22:32
Unlock/Unhide all Power Plan Settings/Options on Windows 10/11
#Requires -RunAsAdministrator
# Unlock-PowerCfg - v22.05.11
# Disable "Connected Standby"
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Power' -Name 'CSEnabled' -Value 0 -Force
# Get Power Settings entries and add/set 'Attributes' to 2 to unhide
$PowerCfg = (Get-ChildItem 'HKLM:\SYSTEM\CurrentControlSet\Control\Power\PowerSettings' -Recurse).Name -notmatch '\bDefaultPowerSchemeValues|(\\[0-9]|\b255)$'
foreach ($item in $PowerCfg) { Set-ItemProperty -Path $item.Replace('HKEY_LOCAL_MACHINE','HKLM:') -Name 'Attributes' -Value 2 -Force }
@tanaikech
tanaikech / submit.md
Last active April 23, 2024 22:31
Multipart-POST Request Using Node.js

Multipart-POST Request Using Node.js

Here, I introduce 2 scripts for uploading files to Slack using Node.js as samples. These 2 sample scripts are for uploading files to Slack.

Sample script 1:

  • You can upload the zip file by converting byte array as follows.
    • At first, it builds form-data.
    • Adds the zip file converted to byte array and boundary using Buffer.concat().
    • This is used as body in request.
@Klerith
Klerith / pasos-node-ts-jest.md
Created August 19, 2023 18:35
Note + TypeScript + Jest = Testing

Pasos para configurar Jest con TypeScript, en Node

Documentación oficial sobre Jest

  1. Instalaciones de desarrollo (super test es útil para probar Express)
npm install -D jest @types/jest ts-jest supertest
@theodorosploumis
theodorosploumis / Nework_throttling_profiles.md
Last active April 23, 2024 22:23
Web development - Custom network throttling profiles
Profile download (kb/s) upload (kb/s) latency (ms)
Native 0 0 0
GPRS 50 20 500
56K Dial-up 50 30 120
Mobile EDGE 240 200 840
2G Regular 250 50 300
2G Good 450 150 150
3G Slow 780 330 200
@afscrome
afscrome / DelayStartAnnotation.cs
Last active April 23, 2024 22:23
Aspire Readiness checks
public class DelayStartAnnotation(IResource waitForResource) : IResourceAnnotation
{
public IResource WaitForResource { get; } = waitForResource;
}
@pauldougan
pauldougan / README.md
Last active April 23, 2024 22:20
Run node.js from gist

Run node.js from a gist

npx https://gist.github.com/pauldougan/45e7e9324257a9b34d1f051b7805e513