Skip to content

Instantly share code, notes, and snippets.

@grugq
grugq / gist:03167bed45e774551155
Last active March 25, 2025 13:11
operational pgp - draft

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

@alexberry
alexberry / automate-ubiquity-ap-leds-homeassistant.md
Last active March 25, 2025 13:11
Automating Ubiquity AP LEDs with Home Assistant & Unifi Network

This is a small guide to set up Unifi AP LED Control using Home Assistant.

Known Supported Hardware

These scripts have been tested as working on the following hardware:

Home Assistant Hosting

@dannote
dannote / final-cut-pro-trial-reset.swift
Last active March 25, 2025 13:10
Final Cut Pro X trial reset
#!/usr/bin/swift
// DISCLAIMER
// This script modifies an unencrypted file associated with the trial version of Final Cut Pro.
// Under the DMCA (17 U.S.C. § 1201), this modification does not qualify as circumvention of a technological
// protection measure (TPM), as it does not involve bypassing encryption, authentication, or similar protections.
// Distributing this code is therefore legal under the DMCA.
// This script is intended for educational and research purposes, such as exploring trial-related file structures,
@xiao0406
xiao0406 / .deps...day1...1.基本数据类型.sol
Created March 25, 2025 13:08
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.26+commit.8a97fa7a.js&optimize=false&runs=200&gist=
// 第一步:确定开源协议
// SPDX-License-Identifier: MIT
// 第二步:确定需要用到的solidity版本 (这两步不可或缺,不然无法编译)
pragma solidity ^0.8.20;
//第三步:
contract HelloWorld {
bool boolVar1 = true;
bool boolVar2 = false;
@devsjc
devsjc / jetbrains_vimrc.vim
Created September 15, 2023 19:50
Example vimrc file from "From JetBrains to Vim" blog post
"=== VIM SETTINGS ====================================================================="
unlet! skip_defaults_vim
source $VIMRUNTIME/defaults.vim
syntax enable
filetype plugin indent on
set hlsearch incsearch ignorecase
set number relativenumber
set wrap linebreak
@aravindhkumar23
aravindhkumar23 / main.dart
Last active March 25, 2025 13:03
Draw over image and export to png from canvas - flutter
import 'dart:io';
import 'dart:async';
import 'dart:typed_data';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
//import 'package:path_provider/path_provider.dart';
//import 'package:simple_permissions/simple_permissions.dart';
@dvf
dvf / change-codec.md
Last active March 25, 2025 13:01
Enable High Quality mode on your headphones (Updated for macOS Catalina)

If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.

Find out what codec you're using

  1. Play a song on your headphones
  2. Option (⌥) click the Bluetooth button at the top of your screen Inspect the Bluetooth Coded
  3. If you're using AAC or aptX, you can stop here—those are the highest quality codecs.

Change your codec to AAC or aptX

@bobbyflowstate
bobbyflowstate / postToInstagram.js
Last active March 25, 2025 12:59
Automated Instagram Poster — Node.js + Dropbox + instagram-private-api
/**
* 🤖 Automated Instagram Poster Node.js + Dropbox + instagram-private-api
*
* This script:
* - Pulls a random image from your Dropbox `/Public` folder
* - Posts it to Instagram using instagram-private-api
* - Adds a random emoji-only caption
* - Deletes the file from Dropbox after posting
* - Runs daily with PM2 cron scheduling
*
@brkunver
brkunver / .prettierrc.json
Created March 25, 2025 12:58
Prettier config
{
"semi": false,
"trailingComma": "all",
"singleQuote": false,
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"jsxSingleQuote": false,
"jsxBracketSameLine": false,
"arrowParens": "avoid"
@jwbee
jwbee / jq.md
Last active March 25, 2025 12:56
Make Ubuntu packages 90% faster by rebuilding them

Make Ubuntu packages 90% faster by rebuilding them

TL;DR

You can take the same source code package that Ubuntu uses to build jq, compile it again, and realize 90% better performance.

Setting

I use jq for processing GeoJSON files and other open data offered in JSON format. Today I am working with a 500MB GeoJSON file that contains the Alameda County Assessor's parcel map. I want to run a query that prints the city for every parcel worth more than a threshold amount. The program is