Skip to content

Instantly share code, notes, and snippets.

😀
Coding!

一波不是一波 riskers

😀
Coding!
Block or report user

Report or block riskers

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@riskers
riskers / Main.ts
Last active Jun 8, 2016
egret init include loading view
View Main.ts
class Main extends egret.DisplayObjectContainer {
private loadingView: LoadingUI;
static stageWidth: number;
static stageHeight: number;
public constructor() {
super();
View egret-music.md

Main.ts

    var music = new Music;
    this.addChild(music)
        
    this.once(egret.TouchEvent.TOUCH_BEGIN,function(){
        music.stop();
        music.play();
    },this)
@riskers
riskers / es6.md
Last active Mar 15, 2018
异步编程
View es6.md

Promise

基本结构

// 创造 Promise 实例

//Promise构造函数接受一个函数作为参数,该函数的两个参数分别是resolve和reject。
var promise = new Promise(function(resolve,reject){	
	//... some code
@riskers
riskers / 0-main.md
Last active Oct 31, 2017
javascript 函数式编程
View 0-main.md

我眼中的函数式

函数式是一种编程范式,面向对象也是一种编程范式。

函数式分为两类,Lisp 和 Haskell,Lisp又有很多方言,Clojure、Scheme 都是其中一种。

JS 函数式

JavaScript 这个语言是基于原型的,可以用构造函数的方法去写 OOP,也可以去写函数式。

@riskers
riskers / cookie-session vs JWT.md
Last active May 24, 2019
cookie-session vs JWT vs oauth
View cookie-session vs JWT.md
@riskers
riskers / DefinePlugin.md
Last active Apr 18, 2019
webpack 应用解析
View DefinePlugin.md

DefinePlugin 定义全局变量

可以根据测试和线上注入全局变量来动态控制逻辑

// webpak.config.js
new webpack.DefinePlugin({
    'ENV': JSON.stringify(process.env.ENV)
})
@riskers
riskers / .tmux.conf
Last active Apr 6, 2017
tmux 配置、快捷键
View .tmux.conf
# unbind some default keybindings
unbind C-b
# set prefix key to ctrl-a
set -g prefix C-a
# lower command delay
set -sg escape-time 1
# start first window and pane at 1, not zero
@riskers
riskers / git-flow.md
Created Apr 12, 2017 — forked from yesmeck/git-flow.md
Git 开发流程
View git-flow.md

Git 协作流程

master 分支

master 永远处于稳定状态,这个分支代码可以随时用来部署。不允许在该分支直接提交代码。

develop 分支

开发分支,包含了项目最新的功能和代码,所有开发都在 develop 上进行。一般情况下小的修改直接在这个分支上提交代码。

@riskers
riskers / demo1.md
Created Jul 13, 2017
es6 module vs require
View demo1.md
// es6
export var foo = 'bar';
setTimeout(() => foo = 'baz', 500);

// main
import {foo} from './t.js';
console.log(foo); // bar
setTimeout(() => console.log(foo), 500); // baz
You can’t perform that action at this time.