Skip to content

Instantly share code, notes, and snippets.

@michaelHL
michaelHL / merge-sort.ipynb
Last active October 19, 2017 14:16
merge sort (in-place)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@michaelHL
michaelHL / cmd.py
Created August 29, 2017 07:26 — forked from dhrrgn/cmd.py
Running a command in Python and optionally processing the output in realtime.
import shlex
import subprocess
import sys
def run_cmd(cmd, callback=None, watch=False):
"""Runs the given command and gathers the output.
If a callback is provided, then the output is sent to it, otherwise it
is just returned.
@michaelHL
michaelHL / scopes.txt
Last active August 29, 2017 07:29 — forked from iambibhas/scopes.txt
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
@michaelHL
michaelHL / py-generator-list.py
Created August 29, 2017 02:37
python - generator vs list
# -*- coding: utf-8 -*- | N Function Runtime
| -----------------------------------------
import time | 1e+00 createGenerator 0.00000000 s
| 1e+00 createGeneratorExp 0.00000000 s
def createGenerator(N): | 1e+00 createList 0.00000000 s
for i in range(N): | -----------------------------------------
yield i * i | 1e+01 createGenerator 0.00000000 s
| 1e+01 createGeneratorExp 0.00000000 s
def createGeneratorExp(N): | 1e+01 createList

删除Outlook所有账户

Outlook删除到最后一个账户不给删除了, 解决方案如下:

  1. Close Outlook.
  2. Run Windows Control Panel.
  3. Open the "Mail (Microsoft Outlook 2016)" applet and click the "Show Profiles..." button.
  4. Remove the existing "Outlook" profile.
  5. Add a new profile, name it "Outlook" and create a new account as needed.
@michaelHL
michaelHL / ezftp.md
Last active July 19, 2017 05:41
C使用ftp命令行上传文件

在同一目录下新建如下文件:

  • ezftp.c

    #include <stdlib.h>
    #include <stdio.h>
    #include <time.h>
    #include <string.h>
@michaelHL
michaelHL / line_break_eof.md
Last active July 9, 2017 17:08
line, break, eof初窥

Line Break 初窥

Linux下

利用

cat > cat.txt
In sleep he sang to me
^D
@michaelHL
michaelHL / texlive_tlmgr.md
Last active July 8, 2017 12:23
TeXLive安装摘要
@michaelHL
michaelHL / mobaxterm_cygwin.md
Last active July 5, 2017 05:31
mobaxterm, cygwin, git related

Mobaxterm&Cygwin折腾笔记

  1. 建议使用10.0版本的Mobaxterm(下简称Moba), 10.2版本的有少许问题, 比如用 apt-get 或者 apt-cyg 不能用 C-c 停止, 不能使用gist-vim插件, git clone也出现各种不能名状的问题.
  2. 配置 Persistent home directory 以及 Persistent root (/) directory, 个人的路径为 F:\WorkingDirectory\Cygwin\home, F:\WorkingDirectory\Cygwin. 关闭Moba, 修改 /etc/fstab 文件, 加上行:
@michaelHL
michaelHL / dokany_sshfs.md
Last active July 5, 2017 05:21
Dokany, sshfs, win-sshfs笔记

Dokany, sshfs, win-sshfs折腾笔记

几个概念

  • Dokany 是一个利用FUSE Wrapper的一个文件系统库. 目前最新版本为1.0.3(25 Mar 2017)
  • sshfs可远程加载系统文件, 应该也是基于FUSE(暂不清楚这些是什么概念), 可在Linux, OSX上使用
  • win-sshfs, 顾名思义,