Skip to content

Instantly share code, notes, and snippets.

View billyma128's full-sized avatar
👨‍💻
I may be slow to respond.

Billy Ma billyma128

👨‍💻
I may be slow to respond.
View GitHub Profile
@billyma128
billyma128 / cloudSettings
Last active February 5, 2020 09:01
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-02-05T09:01:09.961Z","extensionVersion":"v3.4.3"}
@billyma128
billyma128 / introrx.md
Created December 7, 2017 10:24 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
{
"images": [
{
"extent": "full-screen",
"idiom": "iphone",
"filename": "Default-568h@2x.png",
"minimum-system-version": "7.0",
"orientation": "portrait",
"scale": "2x",
"subtype": "retina4"
{
  "AngularJS Component": {
    "prefix": "ngc",
    "description": "AngularJS component",
    "body": [
      "export class ${1:Component}Controller implements ng.IComponentController {",
      "\n\tstatic \\$inject: string[] = ['\\$q', '\\$location', '\\$routeParams', 'dataService'];\n",
      "\t$0\n",
      "\tconstructor(",
function wxRefresh() {
    var replaceQueryParam = (param, newval, search) => {
        var regex = new RegExp('([?;&])' + param + '[^&;]*[;&]?');
        var query = search.replace(regex, '$1').replace(/&$/, '');

        return (query.length > 2 ? query + '&' : '?') + (newval ? param + '=' + newval : '');
    };

 window.location.replace(location.protocol +
@billyma128
billyma128 / isArray.md
Last active March 13, 2017 09:29
为什么在js里用 instanceof 和 constructor 不能完美判断一个数组是不是数组?
var iframe = document.createElement('iframe');
document.body.appendChild(iframe);
xArray = window.frames[window.frames.length-1].Array;
var arr = new xArray(1,2,3); // [1,2,3]

// Boom!
arr instanceof Array; // false

// Boom!
@billyma128
billyma128 / new.md
Created December 22, 2015 14:56
CentOS7.1使用Docker搭建基于Gitlab和Jenkins的Node.js持续集成环境

CentOS7.1使用Docker搭建基于Gitlab和Jenkins的Node.js持续集成环境

标签(空格分隔): 未分类


在上一篇分享中,可以看出gulp能帮我们完成许多工作,但其中并不是所有的任务每个开发人员都用得到,诸如静态资源的打包、远程部署和版本归档等。那么可以把这些工作交给持续集成服务器来做,当开发人员push代码到gitlab的repoA后,触发jenkins执行构建操作,把构建后的代码push到gitlab的repoB,部署时直接从repoB clone最新的代码,如图所示:

Prerequisites

@billyma128
billyma128 / es6-quicksort.js
Last active October 1, 2016 17:29
使用ES6实现快排
function quicksort(head,...tail) {
if (!head) return [];
return quicksort(...tail.filter( _ => _ <= head))
.concat([head])
.concat(quicksort(...tail.filter( _ => _ > head )))
}
// 传入参数quicksort(1,4,2,3)或quicksort(...[1,4,2,3])
@billyma128
billyma128 / sass.md
Last active November 6, 2015 06:28
sass knowledge

Sass和Compass必备技能之Sass篇

[TOC] 标签(空格分隔): CSS预处理 Sass


div
## 1. 目标 1. 使用Sass和Compass写出更优秀的CSS。 2. 结局CSS编写过程中的痛点问题,如精灵图合并图等。 3. 有效组织样式,图片,字体等项目元素