Skip to content

Instantly share code, notes, and snippets.

@simonliu009
simonliu009 / iTerm2 key bindings
Last active December 29, 2018 15:47
[iTerm2快捷键]iTerm2 快捷键及技巧 #iTerm2
^ 代表 shift
“cmd+d” 左右分屏
“^+cmd+d”实现上下分屏
“cmd+f” 搜索及文本复制,可以调出搜索框进行文本搜索,然后按下“tab”键会自动高亮当前文本后面的内容。最后按enter键将高亮文本复制到剪切板上。
“^+cmd+h” 调出复制过的文本历史
“cmd+alt+b” 按键回放
“^+cmd+o” 快速打开profile或者切换到指定tab
@simonliu009
simonliu009 / user_main.c
Last active January 7, 2019 13:59 — forked from 0x6e/user_main.c
ESP8266 Espressif RTC Example #ESP8266 #RTC
#include "ets_sys.h"
#include "osapi.h"
#include "user_interface.h"
os_timer_t rtc_test_t;
#define RTC_MAGIC 0x55aaaa55
typedef struct {
uint64 timeAcc;
uint32 magic;
@simonliu009
simonliu009 / emacs org-mode
Last active January 7, 2019 14:03
emacs: org-mode #emacs
* ** *** 星星数量代表标题级别,最多10级
- 列表,在同一个子标题下,你还可以将内容划分的更细致。
方法是使用这些符号: ‘-’, ‘+’, ‘*’, ‘1.’, ‘1)’。
把光标移动到 ‘1.’ ‘2.’ 或 ‘3.’ 所在的行上,然后按 shift 加左右方向键可以切换风格。
Tab 折叠该级标题
M-<RET> 创建同级标题星号
M-箭头 改变标题顺序
C-x n s 隐藏其它内容,只显示当前标题内容
C-x n w 展开其它内容
C-c C-n 移动到下一个标题
@simonliu009
simonliu009 / emacs key binding 快捷键
Last active February 27, 2020 04:15
emacs: key binding 快捷键 #emacs #快捷键
C-g : 取消当前操作
C-x u : undo
光标向下移动一行 C-n
光标向上移动一行 C-p
光标向上移动一页 C-x [
光标向下移动一页 C-x ]
C-v : 向下翻页
M-v : 向上翻页
@simonliu009
simonliu009 / xcode key bindings
Last active January 7, 2019 14:02
xcode: key bindings #xcode
ctrl+i 格式化代码 format the code
@simonliu009
simonliu009 / Mac open bin
Last active January 7, 2019 14:00
Mac: open bin file 打开二进制文件 #macOS
1. Use sublime text to open this file
2. Use vi to open the file,then input the following command to switch to hex mode:
:%!xxd ——将当前文本转换为16进制格式。
:%!od ——将当前文本转换为16进制格式。
:%!xxd -c 12——将当前文本转换为16进制格式,并每行显示12个字节。
:%!xxd -r ——将当前文件转换回文本格式。
3. emacs
emacs filename
@simonliu009
simonliu009 / vistual studio code short cuts
Last active February 20, 2019 14:47
vsc: vistual studio code 快捷键 #vscode
多光标编辑 Multi cursor selection
基本: Alt+Click 即,按住 Alt 键,依次单击(或者选择)需要编辑的位置,可以依次添加光标。 Alt 键可以在设置中更改。
一列多光标: Shift+Alt+Down 或者 Shift+Alt+Up 可以在上下位置添加光标。
依次选中相同单词: 选中一个单词,按 Ctrl+D ,可以依次选中下一个相同单词。
选中所有相同单词: 选中一个单词,按 Shift+Ctrl+L (shift+cmd+L),可以一次性选中文本中 所有相同单词 。
矩形选择: 按住 Shift+Alt ,再进行选择,则选择区域是一个矩形。
括号选择: Shift+Alt+Right ,会选中匹配括号中的内容,并可以扩大选中区域。
选择相同实例:
@simonliu009
simonliu009 / dec to bin 3
Last active January 7, 2019 13:56
c: int 十进制转二进制输出 dec to bin #c
/*
* @Author: simonliu
* @Date: 2018-04-25 21:48:58
* @Last Modified by: simonliu
* @Last Modified time: 2018-04-25 22:24:15
*/
#define __Mylog__
#ifdef __Mylog__
#define Mylog(format,...) printf("File: " __FILE__ ", Line: %05d: " format "/n", __LINE__, ##__VA_ARGS__)
#else
@simonliu009
simonliu009 / set single bit
Last active January 7, 2019 13:56
c: set bitx to 1 or 0 #c
//设置某位为1
number |= 1 << x; // 设置第x位为1
//清除某位
number &= ~(1 << x); // 置第x位为0
@simonliu009
simonliu009 / int_to_bin
Last active January 7, 2019 13:56
C: printf an integer to binary #c
/*
* @Author: Norton-Linux内核研究
* @Date: 2018-04-25 19:41:08
* @Last Modified by: simonliu
* @Last Modified time: 2018-04-25 19:41:27
* Source: https://blog.csdn.net/xzongyuan/article/details/29562371
*/
#include <stdio.h>
#include "string.h"