Skip to content

Instantly share code, notes, and snippets.

View snowman's full-sized avatar
💭
I may be slow to respond.

snowman snowman

💭
I may be slow to respond.
View GitHub Profile
@snowman
snowman / laughing-man.svg
Created May 23, 2019 14:52 — forked from johan/laughing-man.svg
The Laughing Man (Ghost in the Shell), 1000 byte SVG :-)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@snowman
snowman / alexa.js
Created June 22, 2019 10:56 — forked from chilts/alexa.js
Getting the Alexa top 1 million sites directly from the server, unzipping it, parsing the csv and getting each line as an array.
var request = require('request');
var unzip = require('unzip');
var csv2 = require('csv2');
request.get('http://s3.amazonaws.com/alexa-static/top-1m.csv.zip')
.pipe(unzip.Parse())
.on('entry', function (entry) {
entry.pipe(csv2()).on('data', console.log);
})
;
import os
import sys
import re
import hashlib
import csv
import time
import locale
import getopt
@snowman
snowman / mpvhistory.lua
Created November 12, 2019 02:02 — forked from garoto/mpvhistory.lua
Simple media logger Lua script for mpv
-- Not my code: originally from https://redd.it/3t6s7k (author deleted; failed to ask for permission).
-- Only tested on Windows. Date is set to dd/mmm/yy and time to machine-wide format.
-- Save as "mpvhistory.lua" in your mpv scripts dir. Log will be saved to mpv default config directory.
-- Make sure to leave a comment if you make any improvements/changes to the script!
local HISTFILE = (os.getenv("APPDATA") or os.getenv("HOME").."/.config").."/mpv/mpvhistory.log";
mp.register_event("file-loaded", function()
local title, logfile;
@snowman
snowman / gpg-import-and-export-instructions.md
Created November 13, 2019 05:52 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

@snowman
snowman / makepkg_overview.rst
Created December 20, 2019 14:37 — forked from Earnestly/makepkg_overview.rst
A brief overview of the process involved in creating a pacman package.

A Brief Tour of the Makepkg Process: What Makes a Pacman Package

Introduction

This is a terse document covering the anatomy of a package built for the pacman package manager.

The following example commands can mostly run verbatim to manually create a

@snowman
snowman / styles.css
Last active December 25, 2019 06:02 — forked from patik/styles.css
Numbered Headings in Markdown via CSS
h1 {
counter-reset: h2counter;
}
h2 {
counter-reset: h3counter;
}
h3 {
counter-reset: h4counter;
}
h4 {
@snowman
snowman / weixin.md
Last active April 1, 2020 04:54 — forked from Josscii/weixin.md
wechat_spider 原理扫盲帖

wechat_spider 原理扫盲帖

这篇文章旨在为刚接触 wechat_spider 的人提供一个快速了解这个项目基本原理的途径。

思路

首先我们随便进入一个微信公众号详情页。

@snowman
snowman / For Mac 4.2.6 unlimited trial.md
Created December 7, 2020 06:30 — forked from rise-worlds/For Mac 4.2.6 unlimited trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher,4.2.5,4.2.6 ,it's works , this is the way which makes Always in evaluation mode 。

  1. go to the dir : /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak
  3. touch a file name BCompare , and chmod a+u BCompare
  4. insert BCompare the content :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@
@snowman
snowman / m3u8-to-mp4.md
Created December 9, 2020 03:37 — forked from tzmartin/m3u8-to-mp4.md
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4