Skip to content

Instantly share code, notes, and snippets.

View hotoo's full-sized avatar
🎯
Focusing

闲耘™ hotoo

🎯
Focusing
View GitHub Profile
@fengmk2
fengmk2 / optimized-test.js
Created April 29, 2016 03:00
optimized-test.js
'use strict';
// http://dev.zm1v1.com/2015/08/19/javascript-optimization-killers/?spm=0.0.0.0.Rxyzi2
function testFn(a, b) {
const c = (a || 0) + (b || 1);
return c;
}
function printStatus(fn) {
@atian25
atian25 / README.md
Created March 9, 2016 14:07 — forked from steve-jansen/README.md
Stop and start Symantec Endpoint Protection on OS X

This script enables you stop and start Symantec Endpoint Protection on OS X

Installation

sudo curl https://gist.githubusercontent.com/steve-jansen/61a189b6ab961a517f68/raw/sep -o /usr/local/bin/sep
sudo chmod 755 /usr/local/bin/sep
sudo chown root:staff /usr/local/bin/sep
@chusiang
chusiang / vim-editor-sticker.md
Last active May 24, 2020 14:25
Vim 推廣貼紙

Vim 推廣貼紙

想幫筆電 (Laptop) 貼上 Vim 貼紙嗎?喜歡 Vim 嗎?現在您可以帶回家了!

Vim (editor) sticker

[» 更多照片][more]

  • 貼紙圖檔來源:[File:Vimlogo.svg | Wikimedia Commons][VimLogo.svg]。
  • 尺寸:5cm * 5cm。
@bao3
bao3 / hlink.c
Last active October 7, 2015 14:13
Mac OS X HardLink c file 苹果系统制作硬链接的命令行工具,原作者是 http://www.cppblog.com/biao/archive/2013/09/09/203123.html 。不过从他那边弄下来后会有错误,因此这里将修正好再托管。 顺道吐槽一下,妈的,google中文资料,一帮傻逼全在讨论 mac 硬连接软链接和替身,竟然都不告诉大家怎么制作硬链接。反而硬链接非常有必要,比如你同时有百度网盘,dropbox,onedrive,硬链接帮你解决需要重复放置同一份文件这个问题。
@hotoo
hotoo / commonjs-gf.vim
Last active August 9, 2019 12:58
gf to open commonjs files
" http://usevim.com/2013/01/04/vim101-jumping/
function! InitJavaScript()
setl suffixesadd+=.js
setl isfname+=@-@
let node_modules = finddir('node_modules', expand('%:p:h') . ';')
exec "setl path+=". node_modules
"let project_root=findfile('package.json', expand('%:p:h') . ';')
"exec "setl path+=". fnamemodify(project_root, ':p:h') . "/node_modules"
endfunction
@bpierre
bpierre / README.md
Last active February 15, 2024 18:40
Switch To Vim For Good

Switch To Vim For Good

NOTE: This guide has moved to https://github.com/bpierre/switch-to-vim-for-good

This guide is coming from an email I used to send to newcomers to Vim. It is not intended to be a complete guide, it is about how I switched myself.

My decision to switch to Vim has been made a long time ago. Coming from TextMate 1, I wanted to learn an editor that is Open Source (so I don’t lose my time learning a tool that can be killed), cross platform (so I can use it everywhere), and powerful enough (so I won’t regret TextMate). For these reasons, Vim has always been the editor I wanted to learn, but it took me several years before I did it in a way that works for me. I tried to switch progressively, using the Janus Vim distribution for a few months, then got back to using TextMate 2 for a time, waiting for the next attempt… here is what finally worked for me.

Original gist with comments: https://gist.github.com/bpierre/0a0025d348b6001394e0

# the path where screenshots to save
SS_PATH="/tmp"
# if you want to save them to your desktop, SS_PATH should be "/Users/YOURNAME/Desktop"
# a variable of unix timestamp for screenshot file name
NOW=$(date +%s)
# execute screen capture command, screenshot$NOW.png is the name of file
screencapture -i -r $SS_PATH/screenshot$NOW@2X.png
@steve-jansen
steve-jansen / README.md
Last active February 23, 2024 22:38
Stop and start Symantec Endpoint Protection on OS X

This script enables you stop and start Symantec Endpoint Protection on OS X

Installation

sudo curl https://gist.githubusercontent.com/steve-jansen/61a189b6ab961a517f68/raw/sep -o /usr/local/bin/sep
sudo chmod 755 /usr/local/bin/sep
sudo chown root:staff /usr/local/bin/sep
// ==UserScript==
// @name AliWay Script.
// @version 0.2
// @match http://www.aliway.com/*
// @copyright 2012+, You
// ==/UserScript==
// 删水印
$("div.tpc_content").removeClass("tpc_content").css("padding", "0 15px 20px 15px").css("line-height", "1.5");
@cheeaun
cheeaun / js-error-logging-services.md
Last active December 10, 2023 13:04
JavaScript error logging services