Skip to content

Instantly share code, notes, and snippets.

View crispgm's full-sized avatar
Caffeinated

David Zhang crispgm

Caffeinated
View GitHub Profile
@crispgm
crispgm / pinboard-olivia.css
Last active February 21, 2021 10:51
[Userscripts] Pinboard Olivia Theme on Safari
/* ==UserStyle==
@name Pinboard-Olivia
@description Olivia theme for pinboard.in
@match *://pinboard.in/*
==/UserStyle== */
:root{
--color-0: #ffffff;
--color-1: #e8c4b8;
--color-2: #2b2b2b;
@crispgm
crispgm / geekhack-botanical-theme.css
Last active February 21, 2021 10:48
[UserScripts] Geekhack GMK Botanical Theme on Safari
// ==UserScript==
// @name GeekHack Botanical Theme
// @description A simple Botanical theme for GeekHack
// @author David Zhang
// @match https://geekhack.org/*
// ==/UserScript==
/* GMK Botanical by Hazzy https://geekhack.org/index.php?topic=102350.0 */
:root{
--color-0: #dde5ed;
@crispgm
crispgm / donwload_m3u8_ffmpeg.sh
Created December 13, 2020 16:59
download m3u8 file with ffmpeg
ffmpeg -user_agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/601.7.8 (KHTML, like Gecko) Version/9.1.3 Safari/537.86.7" -i "url_to_m3u8.m3u8" -c copy /path/to/output.mkv
@crispgm
crispgm / geekhack-nord-theme.js
Last active January 17, 2021 08:48
[TamperMonkey] Nord Theme for GeekHack
// ==UserScript==
// @name GeekHack Nord Theme
// @description A simple Nord theme for GeekHack
// @author David Zhang
// @match https://geekhack.org/*
// ==/UserScript==
:root{
--color-0: #ECEFF4;
--color-1: #5E81AC;
package main
import (
"fmt"
"time"
)
func main() {
loc, _ := time.LoadLocation("Asia/Shanghai")
t := time.Now().In(loc)

Keybase proof

I hereby claim:

  • I am crispgm on github.
  • I am crispgm (https://keybase.io/crispgm) on keybase.
  • I have a public key ASAdGm896HU6rlyeNwP5ubKwDHvixAp9L72QhvkL_rty8wo

To claim this, I am signing this object:

@crispgm
crispgm / crontab-log.sh
Last active January 3, 2020 06:15
View crontab log
grep CRON /var/log/syslog
@crispgm
crispgm / random-sample.awk
Last active December 17, 2018 09:31
Random sample from a file with awk
awk 'BEGIN {srand()} !/^$/ { if (rand() <= .01) print $0}'
@crispgm
crispgm / remove_file_from_last_commit.sh
Last active December 31, 2019 02:53 — forked from 0x8BADFOOD/remove_file_from_last_commit
[Git] Remove file from last commit
# roll back commit
git reset --soft HEAD^
# remove file from index
git reset HEAD path/to/unwanted_file
# commit again without unwanted files
git commit -m "My commit message"
# Source: http://stackoverflow.com/questions/12481639/remove-files-from-git-commit
@crispgm
crispgm / this_year_rails.rb
Created July 4, 2017 03:03
Monkey partch to add `this_year?` to Rails
module DateAndTime
module Calculations
def this_year?
year == ::Date.current.year
end
end
end