Skip to content

Instantly share code, notes, and snippets.


slow-is-fast slow-is-fast

View GitHub Profile
View alacritty.yml
# 默认窗口无标题栏,16:9的窗口比例启动
# decorations: "none"
# dimensions:
# columns: 120
# lines: 30
startup_mode: Maximized
# 背景半透明,方便抄代码
background_opacity: 0.9
slow-is-fast /
Created Jul 10, 2020 — forked from Takhion/
Collection of methods to achieve better circular arc drawing, as Canvas.drawArc() is unreliable. See the related article:
* Copyright (c) 2014 BioWink GmbH.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
slow-is-fast /
Created May 18, 2020
Laravel Model observer get changed data
    public function updated(Order $order)
        $originals = [];
        if ($order->isDirty('order_status')) {
            Log::info("order new status :" . $order->order_status . " -- old status :" . $order->getOriginal('order_status'));
        foreach ($order->getDirty() as $key => $val) {
            $originals[$key] = $order->getOriginal($key);
import hashlib

def file_md5(fname):
    hash_md5 = hashlib.md5()
    with open(fname, "rb") as f:
        for chunk in iter(lambda:, b""):
    return hash_md5.hexdigest()
slow-is-fast /
Created Oct 18, 2019 — forked from canering/
Install most of my Apps with homebrew & cask
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install and Set San Francisco as System Font
ruby -e "$(curl -fsSL"
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL"
slow-is-fast / gist:b3d6fba9218d36e318d116836035bb5f
Created Apr 26, 2019 — forked from andphe/gist:3232343
Export your links from Safari reading list
View gist:b3d6fba9218d36e318d116836035bb5f
/usr/bin/plutil -convert xml1 -o - ~/Library/Safari/Bookmarks.plist | grep -E -o '<string>http[s]{0,1}://.*</string>' | grep -v icloud | sed -E 's/<\/{0,1}string>//g'
exiftool  "-CreateDate<FileModifyDate" "-DateTimeOriginal<FileModifyDate" "-ModifyDate<FileModifyDate" -overwrite_original .
View gist:3f57be7e1b1055fb300c3bb955f68649
pip install -U git+
View keybind_like_emacs.js
/*============= Emacs Style =============*/
{ "keys": ["ctrl+b"], "command": "move", "args": {"by": "characters", "forward": false} },
{ "keys": ["ctrl+f"], "command": "move", "args": {"by": "characters", "forward": true} },
{ "keys": ["ctrl+p"], "command": "move", "args": {"by": "lines", "forward":
false} },
{ "keys": ["ctrl+n"], "command": "move", "args": {"by": "lines", "forward":
true} },
{ "keys": ["ctrl+a"], "command": "move_to", "args": {"to": "bol", "extend": false} },
{ "keys": ["ctrl+e"], "command": "move_to", "args": {"to": "eol", "extend": false} },
View removeEmoji.php
function removeEmoji($text)
$cleanText = "";
// Match Emoticons
$regexEmoticons = '/[\x{1F600}-\x{1F64F}]/u';
$cleanText = preg_replace($regexEmoticons, '', $text);
// Match Miscellaneous Symbols and Pictographs
$regexSymbols = '/[\x{1F300}-\x{1F5FF}]/u';