Skip to content

Instantly share code, notes, and snippets.

Avatar
👍
Yes, that should work. Drink herbal tea?

Jack Cherng jfcherng

👍
Yes, that should work. Drink herbal tea?
View GitHub Profile
@jfcherng
jfcherng / Symbol List - Heading.tmPreferences
Last active Sep 12, 2021
ST 4083 Markdown headings beautifying
View Symbol List - Heading.tmPreferences
<?xml version="1.0" encoding="UTF-8"?>
<plist version="1.0">
<dict>
<key>scope</key>
<string>text.html.markdown markup.heading - meta.whitespace.newline.markdown</string>
<key>settings</key>
<dict>
<key>showInSymbolList</key>
<integer>1</integer>
<key>symbolTransformation</key>
@jfcherng
jfcherng / st4-kind-scope-relationship
Last active Aug 10, 2021
ST 4 Autocompletion: Kind <---> Scope relationship
View st4-kind-scope-relationship
https://discord.com/channels/280102180189634562/280157067396775936/736233105295278120
keyword:
keyword
storage.modifier
storage.type
keyword.declaration
variable.language
constant.language
type:
@jfcherng
jfcherng / .env
Created Jun 9, 2020
Symfony 5 maintenance mode
View .env
MAINTENANCE_MODE=0
@jfcherng
jfcherng / CompletionItemDemo.py
Last active Aug 10, 2021
Sublime Text 4 demo: CompletionItem (Min ST version: 4073)
View CompletionItemDemo.py
import sublime
import sublime_plugin
# @see https://discordapp.com/channels/280102180189634562/280157067396775936/697124502244687984
class CompletionItemDemoListener(sublime_plugin.EventListener):
def on_query_completions(self, view, prefix, locations):
return (
[
sublime.CompletionItem(
@jfcherng
jfcherng / st4-changelog.md
Last active Sep 5, 2021
Sublime Text 4 changelog just because it's not on the official website yet.
View st4-changelog.md
@jfcherng
jfcherng / SimpleCrypto.php
Created Oct 26, 2019
Yet another simple encryption/decryption wrapper.
View SimpleCrypto.php
<?php
declare(strict_types=1);
namespace App\Core;
use RuntimeException;
class SimpleCrypto
{
@jfcherng
jfcherng / sublime.py
Last active Jul 14, 2020
sublime.py - patched for v3211
View sublime.py
import sys
import sublime_api
class _LogWriter:
def flush(self):
pass
def write(self, s):
@jfcherng
jfcherng / regex-expand.py
Created Aug 5, 2019
Expand compacted regex expression
View regex-expand.py
import functools
import os
import re
import sys
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
# https://github.com/asciimoo/exrex
import exrex
@jfcherng
jfcherng / ChtStroke.php
Last active Dec 15, 2020 — forked from blackbing/big5_stroke.tab
中文筆劃排序(只適用繁體中文) for PHP 7.2
View ChtStroke.php
<?php
/**
* Author: blackbing@gmail.com
* Desc: 為了解決中文筆劃排序的問題(只適用繁體中文)
* php 可以直接執行 cht_strokesort.
*/
final class ChtStroke
{
const BIG5_HB_MIN = 0x81; // 高位元組最小值
@jfcherng
jfcherng / Python3.7-Build.txt
Last active Jul 16, 2021 — forked from Nesffer/Python3.5-Build.txt
Python 3.7 Build on Ubuntu 16.04
View Python3.7-Build.txt
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_bz2 _curses _curses_panel
_dbm _gdbm _lzma
_sqlite3 _ssl _tkinter
readline zlib _uuid
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
sudo apt install libbz2-dev libncurses5-dev libgdbm-dev liblzma-dev sqlite3 libsqlite3-dev openssl libssl-dev tcl8.6-dev tk8.6-dev libreadline-dev zlib1g-dev uuid-dev