Skip to content

Instantly share code, notes, and snippets.

View pygman's full-sized avatar
🏠
Working from home

pygman pygman

🏠
Working from home
View GitHub Profile
@pygman
pygman / git_toturial
Created June 6, 2017 06:24 — forked from guweigang/git_toturial
git命令大全
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "xxx@xxx.com" # 配置邮件
git config --global color.ui true # git status等命令自动着色
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global --unset http.proxy # remove proxy configuration on git
git clone git+ssh://git@192.168.53.168/VT.git # clone远程仓库
@pygman
pygman / mpeg.sh
Created October 10, 2016 08:21
添加音乐支持 软音源timidity 和 mpeg
sudo apt-get install libsmpeg0 libsmpeg-dev
@pygman
pygman / add-apt-repository.sh
Last active September 29, 2018 09:48
Debian系列添加PPA源支持 add-apt-repository
sudo apt-get install python-software-properties //首先尝试安装这个软件
sudo apt-get install software-properties-common //上面尝试如果add-apt-repository不能运行,尝试安装这个软件
sudo apt-get install apt-file
sudo apt-file update
# 测试成功
# ss 使用
apt-file search add-apt-repository
sudo add-apt-repository ppa:hzwhuang/ss-qt5
@pygman
pygman / .Xmodmap
Last active October 4, 2016 11:05
Debian系桌面Linux 键盘设置 Dvorak和CapsLock
! http://www.mit.edu/~jcb/Dvorak/dvorak-keyboard.txt
!
! ANSI Dvorak keyboard
!
! Author: Jeff Bigler (jcb@mit.edu)
! Last modified: 1996/08/27 13:45:30 by jcb@mit.edu
!
! This file should be given as an argument to xmodmap to
! switch from a qwerty to a Dvorak keyboard.
!
@pygman
pygman / 代码诗词.markdown
Created September 21, 2016 05:06
代码诗词
  1. 物是人非事事休,欲语泪先流。
((item)&&(!people))
everything=false;
if (tears.setFlowing())
    try{
        Speaker skr=new Speaker();
    }catch{IOException e;} ( )
  1. 抽刀断水水更流,举杯消愁愁更愁。
@pygman
pygman / immutable-design.markdown
Created September 19, 2016 10:12
Java 不可变类的设计方法 immutable
  1. 类添加final修饰符,保证类不被继承。

如果类可以被继承会破坏类的不可变性机制,只要继承类覆盖父类的方法并且继承类可以改变成员变量值,那么一旦子类以父类的形式出现时,不能保证当前类是否可变。 2. 保证所有成员变量必须私有,并且加上final修饰

通过这种方式保证成员变量不可改变。但只做到这一步还不够,因为如果是对象成员变量有可能再外部改变其值。所以第4点弥补这个不足。 3. 不提供改变成员变量的方法,包括setter

避免通过其他接口改变成员变量的值,破坏不可变特性。 4. 通过构造器初始化所有成员,进行深拷贝(deep copy)

@pygman
pygman / Strman.java
Created September 18, 2016 02:32
Strman Java字符串处理库 学习
/*
*
* * The MIT License
* *
* * Copyright 2016 Shekhar Gulati <shekhargulati84@gmail.com>.
* *
* * 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
@pygman
pygman / Dvorak.ini
Created September 14, 2016 08:21
搜狗输入法 双拼
[metadata]
title=德沃夏克NEW
[声母]
z=i
zh=E
ch=A
sh=O
[韵母]
@pygman
pygman / find.markdown
Created September 14, 2016 05:59
find命令基本使用一览

find命令基本使用一览

find命令相对于locate这种非实时查找的搜索命令,大大增加了我们搜索的便捷度以及准确性;并且能够方便的帮助我们对大文件、特定类型的文件查找与删除,特别是有超多小碎文件的时候,更是方便至极....

根据属主 属组查找

   -user username:查找属主是xx的文件
   -group group:查找属组的xx文件
   -uid useruid:查找uid号的文件
   -gid groupid:查找gid号的文件
   -nouser:查找没有属主的文件,即文件存在但是 user已被删除