Skip to content

Instantly share code, notes, and snippets.

View githubxiaowen's full-sized avatar
💭
I may be slow to respond.

萧文 githubxiaowen

💭
I may be slow to respond.
  • Beijing China
View GitHub Profile
@githubxiaowen
githubxiaowen / symbol.js
Last active December 5, 2018 07:00
webpack-related
// Object.prototype.toString()
// "[object Object]"
// let obj = {}
// undefined
// obj.toString()
// "[object Object]"
// obj.a=1
// 1
// obj.toString()
// "[object Object]"
@githubxiaowen
githubxiaowen / html.js
Created November 28, 2018 06:52
template-engine
// https://github.com/Polymer/polymer/blob/master/lib/utils/html-tag.js#L94-L99
export const html = function html(strings, ...values) {
const template = /** @type {!HTMLTemplateElement} */(document.createElement('template'));
template.innerHTML = values.reduce((acc, v, idx) =>
acc + htmlValue(v) + strings[idx + 1], strings[0]);
return template;
};
@githubxiaowen
githubxiaowen / README.md
Last active September 7, 2018 03:35
learning-vue

learning vue

@githubxiaowen
githubxiaowen / README.md
Last active May 12, 2018 03:07
http2-nginx-node-demo

安装依赖

image

  1. 安装dnsmasq 以及nginx
# Install dnsmasq via homebrew
$ brew install dnsmasq; 

# Add dnsmasq config 
$ cat << EOF > /usr/local/etc/dnsmasq.conf
@githubxiaowen
githubxiaowen / mixin.scss
Last active May 9, 2018 11:04
useful js functions
@mixin border-1px ($position: all, $border-width:1px, $border-style:solid, $border-color:$border-color, $border-radius:0) {
$_position: $position;
@if $_position == all {
$_position: '';
} @else {
$_position: '-' + $position;
};
position: relative;
&:after{
display: block;
@githubxiaowen
githubxiaowen / index.html
Created April 13, 2018 05:48
webgl-starter-util-randomTriangle
<canvas id="container"></canvas>
<script type="webgl/vertex-script" id="vertexShader">
attribute vec2 vertexPosition;
void main(){
gl_Position = vec4(vertexPosition, 0.0, 1.0);
}
</script>
<script type="webgl/fragment-script" id="fragmentShader">
// https://stackoverflow.com/questions/28540290/why-it-is-necessary-to-set-precision-for-the-fragment-shader
@githubxiaowen
githubxiaowen / index.html
Last active April 13, 2018 03:32
webgl-starter-util
<canvas id="container"></canvas>
<script type="webgl/vertex-script" id="vertexShader">
attribute vec2 vertexPosition;
void main(){
gl_Position = vec4(vertexPosition, 0.0, 1.0);
}
</script>
<script type="webgl/fragment-script" id="fragmentShader">
// https://stackoverflow.com/questions/28540290/why-it-is-necessary-to-set-precision-for-the-fragment-shader
@githubxiaowen
githubxiaowen / starUML.md
Created April 8, 2018 05:09 — forked from trandaison/starUML.md
Get full version of StarUML

StarUML

Download: StarUML.io

Crack

Source: jorgeancal

After installing StartUML successfully, modify LicenseManagerDomain.js as follow:

/**
@githubxiaowen
githubxiaowen / jump.js
Created January 5, 2018 04:02
jump-wx
let scene=new THREE.Scene();
let camera= new THREE.PerspectiveCamera(45,window.innerWidth/window.innerHeight,1,1000)
let renderer=new THREE.WebGLRenderer();
let stats;
let controller;
let sphere ;
let startPoint;
let jumpPoint = []
let rAFId ;
let jumpV ;