Skip to content

Instantly share code, notes, and snippets.

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

Programmer Alan appleshan

🏠
Working from home
View GitHub Profile
@echo off
setlocal ENABLEDELAYEDEXPANSION
set /a tee=0
for /f "tokens=1* delims==" %%a in (
'wmic DESKTOPMONITOR get ScreenWidth^,ScreenHeight^ /value'
) do (
set /a tee+=1
if "!tee!" == "3" set screenheight=%%b
if "!tee!" == "4" set screenwidth=%%b
@appleshan
appleshan / socks.el
Created December 22, 2017 10:09 — forked from et2010/socks.el
socks proxy settings for emacs url package.
(setq url-gateway-method 'socks)
(setq socks-server '("Default server" "127.0.0.1" 1080 5))
@appleshan
appleshan / 0-show-lis-api-service.bat
Created January 15, 2018 07:42
Windows bat script 监控本地网络及服务
@echo off
SETLOCAL EnableDelayedExpansion
set "curl_install=D:\daan\bin\curl-7.57.0"
set "iconv_install=D:\daan\bin\libiconv-1.9.2-1\bin"
set url-config-file=url-config.txt
REM set "local_service_url=http://wl.ykhealth.cn:11300"
set /P local_service_url=< %url-config-file%
myWay远程办公网址导航 - http://myway.leanapp.cn/
远程.work - https://yuancheng.work/
一早一晚 - http://yizaoyiwan.com/
https://yousails.com/
@appleshan
appleshan / 报告 Bug 格式
Created January 26, 2018 14:22
报告 Bug 格式
报告 Bug 格式:
重现步骤
预期结果
实际结果
版本信息
#!/bin/bash
set -e
readonly version="25.3" # "25.2" # "25.1"
#version_postfix="-rc2" # ".90"
#patch_version=25.2-rc1-mac-6.2
#source_url=ftp://alpha.gnu.org/gnu/emacs/pretest
source_url=https://mirrors.tuna.tsinghua.edu.cn/gnu/emacs
@appleshan
appleshan / gist:24f30cfeff8cccc1b26cb45c372949c2
Created February 8, 2018 02:40 — forked from baepiff/gist:3431336
Remove log file script
#!/bin/bash
LOG_DIR="/usr/local/app/*/logs"
#old log erase
find ${LOG_DIR} -type f -name "myAllipcation*" -mtime +31 | xargs rm -f
find ${LOG_DIR} -type f -name "gc.log*" -mtime +31 | xargs rm -f
@appleshan
appleshan / git.md
Created March 2, 2018 07:55 — forked from suziewong/git.md
github的多人协作?how to 贡献代码?

github的多人协作

  1. github上你可以用别人的现成的代码 直接 git clone 即可了

  2. 然后你也想改代码或者贡献代码咋办?

Fork

;; spacemacs workgroups2
(defun appleshan-navigation/init-workgroups2 ()
(use-package workgroups2
:init (require 'workgroups2)
:config
(progn
(setq wg-session-load-on-start nil) ; default: (not (daemonp))
;; Change prefix key (before activating WG)
(setq wg-prefix-key (kbd "C-c z"))

Git 的坑

在 windows 下的文件的权限因为无法和 linux 上完全一致,所以用 Git 检出的文件权限可能显示为被更改。 另外因为 windows 下的换行和 linux 上也不一样,协作开发时也容易出问题。所以在 windows 上使用 Git 的同学需要加上以下 2 行配置参数:

git config –global core.filemode false git config –global core.autocrlf true

第一句是忽略文件权限的改动。 第二句是将文件 checkout 时自动把 LF 转成 CRLF,check in 时自动把 CRLF 转成 LF