Skip to content

Instantly share code, notes, and snippets.

View b19g3r's full-sized avatar
:octocat:

b19g3r b19g3r

:octocat:
  • 山东青岛
View GitHub Profile

Refactoring by Martin Fowler

Steps

  1. Test, change in small and repeat
  2. Class methods should use data from itself and not other classes(Extract method and move method)
  3. Avoid local temporary variables - it tends to increase compexity and long code
  4. Instead of conditions use polymorphism(Replace conditional with polymorphism)

Avoid refactor

  1. When close to deadline
@b19g3r
b19g3r / fix-dirty-ntfs.md
Created September 8, 2024 13:11 — forked from yordanoweb/fix-dirty-ntfs.md
Fix dirty NTFS disk from Linux

Fix dirty NTFS disk from Linux

The problem

Sometimes when try to mount an NTFS disk in Linux, you get at journalctl the error:

ene 17 10:52:55 hp3nvyl17 kernel: ntfs3: sda1: It is recommened to use chkdsk.
ene 17 10:52:55 hp3nvyl17 kernel: ntfs3: sda1: volume is dirty and "force" flag is not set!
@b19g3r
b19g3r / clash_ini.ini
Last active January 15, 2024 03:18
clash_ini.ini
[custom]
;不要随意改变关键字,否则会导致出错
;acl4SSR规则
;去广告:支持
;自动测速:支持
;微软分流:支持
;苹果分流:支持
;增强中国IP段:支持
;增强国外GFW:支持
# 去除动态中的话题
#^https?:\/\/api\.vc\.bilibili\.com\/topic_svr\/v1\/topic_svr url reject-dict
# 去除动态中的最常访问
#^https?:\/\/api\.vc\.bilibili\.com\/dynamic_svr\/v1\/dynamic_svr\/mix_uplist url reject-dict
# 可能的一些推广(beta)
@b19g3r
b19g3r / logback.xml
Created April 16, 2021 06:50
logback.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>[%d{dd-MM-yyyy HH:mm:ss.SSS}] %magenta([%thread]) [%highlight(%-5level)] %C:%L %M | %msg%n</pattern>
</encoder>
</appender>
<root level="info">
<appender-ref ref="STDOUT" />
</root>
@b19g3r
b19g3r / README.md
Created September 10, 2019 03:39 — forked from joyrexus/README.md
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@b19g3r
b19g3r / gist:186ca7645d5480d24517553e64de6a00
Created August 3, 2018 01:55 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@b19g3r
b19g3r / tmux-cheatsheet.markdown
Created June 15, 2018 17:06 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表

Tmux 快捷键 & 速查表

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

tmux at [-t 会话名]