Skip to content

Instantly share code, notes, and snippets.

View fukurouzhong's full-sized avatar
🎯
Focusing

Peter Zhong fukurouzhong

🎯
Focusing
View GitHub Profile
const PENDING = 0;
const FULLFILLED = 1;
const REJECTED = 2;
function CustomPromise(executor) {
let state = PENDING;
let value = null;
let handlers = [];
let catches = [];
@fukurouzhong
fukurouzhong / gist:040ec8bc0ab056803945aaa81ca9d481
Created April 2, 2019 08:16
How To Learn Any Programming Language_Javascript
From this link: https://www.youtube.com/watch?v=UFS7gi6LXhw&list=PLVpAurZqkV67DYxp5L8bx1g1yzE2hTe8m&index=12
1. Learn language basic
a. Variable Types
b. Operators
c. Basic input and output
d. Print something on STDOUT
e. Basic program structure
@fukurouzhong
fukurouzhong / gist:249cff8b363f9ff31144cc216f669f07
Created March 4, 2017 07:43
How to delete untracked files in git
# delete untracked files
git clean -f
# delete untracked files as well as the directories
git clean -fd
# including gitignore file/directories (慎用,一般这个是用来删掉编译出来的 .o之类的文件用的)
git clean -xfd
# before using git clean,with -n parameter to preview the files or directories will be deleted
@fukurouzhong
fukurouzhong / gist:c0fe7f1aeb2df25ca37fe531833842a8
Created February 17, 2017 07:22
git pull: There is no tracking information for the current branch
use
git branch --set-upstream-to=origin/master master
then git pull again.
@fukurouzhong
fukurouzhong / gist:f98b70058bbb1853262554d56458cd92
Last active December 15, 2016 08:49
[error: src refspec master does not match any] when push into github
solution:
touch README.md
git add README.md
git commit -m 'first commit'
git push -u origin master
@fukurouzhong
fukurouzhong / gist:412f3a316f2f830a517552e8a67844e9
Created May 27, 2016 01:46
TODO: elpa.gnu.org:80 times out when install packages
using OS X EI Capitan 10.11.3
using customization of purcell https://github.com/purcell/emacs.d
tried customization of prelude https://github.com/bbatsov/prelude it works.
@fukurouzhong
fukurouzhong / gist:bb2c9eaa995578f7f85d59d4cb894de4
Created May 25, 2016 01:11
meta key doesn't work in emacs starting from terminal/ mac
# using emacs 24.5
1.fixing this in mac's default terminal by
open your Terminal app, click on the Terminal > Preferences > Settings > Keyboard, mark the option "Use option as meta key"
@fukurouzhong
fukurouzhong / gist:368916c1bbd6257e297c02e54c7568e3
Created May 24, 2016 02:32
problem getting CSS file included using yeoman generator
https://github.com/yeoman/generator-angular/issues/1116
@fukurouzhong
fukurouzhong / gist:695b6f4ae3edbd5a8648f1b9e7e6b09a
Last active April 6, 2017 05:47
ssh: connect to host https port 22: Operation timed out
## push文件到github时的问题
fukurous-MacBook-Air:AngularJS-starter fukurou$ git push -u origin master
ssh: connect to host https port 22: Operation timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
##解决
重新create了一个repo,没有initialize with a readme.file就没有出现这个问题。
@fukurouzhong
fukurouzhong / gist:0b857fd5e554f97d989606ba1d64d3dd
Created May 16, 2016 15:49
Jquery中获得文字内容和改变文字内容的方法
$(selector).html("text to be change");