Skip to content

Instantly share code, notes, and snippets.

View frantic1048's full-sized avatar
🐇

Jiahao Guo frantic1048

🐇
View GitHub Profile
@mosquito
mosquito / README.md
Last active April 13, 2025 18:03
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/[email protected]. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@robertpainsi
robertpainsi / commit-message-guidelines.md
Last active May 7, 2025 20:05
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active May 14, 2025 19:31
Hyperlinks in Terminal Emulators
@MatheusFaria
MatheusFaria / pokedex_ascii.h
Last active May 2, 2025 20:18
151 Pokemon ASCII Art
/**
* The ASCII arts were extracted from:
* - http://www.fiikus.net/?pokedex
* - http://www.world-of-nintendo.com/pictures/text/
* And also generated with:
* - http://www.text-image.com
*/
#ifndef __POKE_IMG__
#define __POKE_IMG__
@stigok
stigok / githook.js
Last active July 8, 2024 14:56
Verify GitHub webhook signature header in Node.js
/*
* Verify GitHub webhook signature header in Node.js
* Written by stigok and others (see gist link for contributor comments)
* https://gist.github.com/stigok/57d075c1cf2a609cb758898c0b202428
* Licensed CC0 1.0 Universal
*/
const crypto = require('crypto')
const express = require('express')
const bodyParser = require('body-parser')

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@nzakas
nzakas / githubpainpoints.md
Created June 30, 2016 18:47
An overview of my pain points with GitHub

GitHub Pain Points

This is my feedback on using GitHub to manage a popular project (ESLint). Topics are presented in no particular order. In general, everything I say about issues also refers to pull requests.

For each problem I've suggested a solution. I realize that actually building out a solution is a complex process and my suggestions do not reach the level of detail sufficient for implementation purposes. It's just to give you an idea of the direction I'm thinking.

Problem: No good way to distinguish new issues from "accepted" issues

Users are opening new issues every day, and these issues automatically bubble to the top of the issues list by default. We do label issues that we're committed to doing as "accepted", but if there are enough new issues, you don't even see those until the second page of issues. Why is this a problem? In a word: distraction.

@Brainiarc7
Brainiarc7 / VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
Last active May 18, 2025 15:48
This gist contains instructions on setting up FFmpeg and Libav to use VAAPI-based hardware accelerated encoding (on supported platforms) for H.264 (and H.265 on supported hardware) video formats.

Using VAAPI's hardware accelerated video encoding on Linux with Intel's hardware on FFmpeg and libav

Hello, brethren :-)

As it turns out, the current version of FFmpeg (version 3.1 released earlier today) and libav (master branch) supports full H.264 and HEVC encode in VAAPI on supported hardware that works reliably well to be termed "production-ready".

@swordfeng
swordfeng / basecourvalue.js
Created June 2, 2016 12:22
A 'Chinese Specific Socialism Core Value' (or somehow a name like that) -based binary encoder.
var zlib = require('zlib');
var values = ['富强', '民主', '文明', '和谐', '自由', '平等', '公正', '法治', '爱国', '敬业', '诚信', '友善'];
var nums = {};
for (var i = 0; i < 12; i++) nums[values[i]] = i;
var primes = [2, 3, 5, 7, 11, 13, 17, 19];
function encode(str) {
var buf = Buffer(str, 'utf8');
if (buf.length === 0) return '';
var results = [];
@MaskRay
MaskRay / pcap2ap
Created May 30, 2016 17:04
pcap2ap: exemplify inotifywait
#!/bin/zsh
set -e -u
setopt nullglob
program=$0
dshell_defcon=${0:a:h}/dshell-defcon
pcap_suffix=.cap
ap_suffix=.ap
opt_recursive=