Skip to content

Instantly share code, notes, and snippets.

Avatar
🔥
Learning Javascript and algorithm

Aaron youyiqin

🔥
Learning Javascript and algorithm
View GitHub Profile
@wavded
wavded / promise.js
Last active May 6, 2021
Promise A+ Implementation
View promise.js
"use strict"
var Promise = function () {
this.state = 'pending'
this.thenables = []
}
Promise.prototype.resolve = function (value) {
if (this.state != 'pending') return
this.state = 'fulfilled'
@jimothyGator
jimothyGator / README.md
Last active Nov 16, 2021
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
View README.md
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@ninehills
ninehills / delay
Created Mar 9, 2011
Linux下用来延时执行命令的小脚本
View delay
#!/bin/bash
# 参数1:延迟的时间,单位s
# 参数2:需要执行的命令
# example:
# delay 10 "conky -d"
sleep $1
exec $2