Skip to content

Instantly share code, notes, and snippets.

View Jamlee's full-sized avatar
🐛
Focusing

JamLee Jamlee

🐛
Focusing
View GitHub Profile
default: all
OUTDIR=out
CFLAGS=-g -Wall
INCLUDES=-I../src
# 测试依赖内容
OBJECTS=main.o adlist.o zmalloc.o
$(foreach i,$(OBJECTS),$(eval "$(OUTDIR)/$(subst .o,,$(i)).o:$(subst .o,,$(i)).c"))
@Jamlee
Jamlee / generator-promise.js
Last active April 10, 2021 21:49
异步: promise, javascript 实现
var fs = require('fs');
var readFile = function (fileName){
return new Promise(function (resolve, reject){
fs.readFile(fileName, function(error, data){
if (error) reject(error);
resolve(data);
});
});
};
@Jamlee
Jamlee / php-cs-fixer-pre-commit.php
Last active November 3, 2020 12:20 — forked from mardix/php-cs-fixer-pre-commit.php
Git: A pre-commit hook to make PHP code PSR-2 compliant, check for syntax error
#!/usr/bin/php
<?php
/**
* .git/hooks/pre-commit
*
* This pre-commit hooks will check for PHP error (lint), and make sure the code
* is PSR compliant.
*
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer)
*