Skip to content

Instantly share code, notes, and snippets.

View soopyc's full-sized avatar
:electron:
remember atom

soopyc

:electron:
remember atom
  • Hong Kong
  • 11:07 (UTC +08:00)
View GitHub Profile
@mary-ext
mary-ext / schema.json
Last active February 21, 2025 13:31
JSON schema for AT Protocol lexicon documents
{
"type": "object",
"properties": {
"lexicon": { "type": "number", "const": 1 },
"id": {
"type": "string",
"pattern": "^[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(\\.[a-zA-Z]([a-zA-Z]{0,61}[a-zA-Z])?)$"
},
"revision": { "type": "integer", "minimum": 0 },
"description": { "type": "string" },
#!/bin/bash
# screenshot.sh kde plasma wayland edition
# depends on imagemagick and spectacle
# Arch Linux: sudo pacman -Sy spectacle imagemagick
# usage: ./plasma-wayland-screenshot.sh (area|active|full)
# EDIT THESE
UPLOAD_URL=""
KEY=""
@BoGnY
BoGnY / README.md
Last active March 7, 2025 17:08
[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

[WINDOWS] How to enable auto-signing Git commits with GnuPG for programs that don't support it natively

This is a step-by-step guide on how to enable auto-signing Git commits with GPG for every applications that don't support it natively (eg. GitHub Desktop, Eclipse, Git Tower, ...)

Requirements

  • Install GPG4Win: this software is a bundle with latest version of GnuPG v2, Kleopatra v3 certificate manager, GNU Privacy Assistant (GPA) v0.9 which is a GUI that uses GTK+, GpgOL and GpgEX that are respectively an extension for MS Outlook and an extension for Windows Explorer shell
  • Install Git for Windows: so you can have a *nix based shell, this software is a bundle with latest version of Git which use MINGW environment, a Git bash shell, a Git GUI and an extension for Windows Explorer shell (Make sure your local version of Git is at least 2.0, otherwise Git don't have support for automatically sign your commits)
  • Verify
@koop
koop / ensure-cert-macos.sh
Created November 28, 2017 20:27
Ensures a certificate is in the macOS system keychain.
#!/bin/bash
# Usage
# $ ./install-cert-macos.sh "/path/to/cert"
CERT_PATH="$1"
# First, grab the SHA-1 from the provided SSL cert.
CERT_SHA1=$(openssl x509 -in "$CERT_PATH" -sha1 -noout -fingerprint | cut -d "=" -f2 | sed "s/://g")
# Next, grab the SHA-1s of any standard.dev certs in the keychain.
# Don't return an error code if nothing is found.
@heavywatal
heavywatal / thread_pool.py
Last active December 21, 2022 08:36
Example of thread pool in Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Example of thread pool
https://docs.python.org/3/library/concurrent.futures.html
https://docs.python.org/3/library/multiprocessing.html
"""
import concurrent.futures as confu
import multiprocessing.pool as mpp
import time
@eyecatchup
eyecatchup / git-commit-log-stats.md
Last active February 6, 2025 14:35
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@solenoid
solenoid / gist:1372386
Created November 17, 2011 04:49
javascript ObjectId generator
var mongoObjectId = function () {
var timestamp = (new Date().getTime() / 1000 | 0).toString(16);
return timestamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, function() {
return (Math.random() * 16 | 0).toString(16);
}).toLowerCase();
};