Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
Working

Jade zjhiphop

:shipit:
Working
View GitHub Profile
@zjhiphop
zjhiphop / WebGL-frameworks-libraries.md
Created Jan 24, 2018 — forked from dmnsgn/WebGL-WebGPU-frameworks-libraries.md
A collection of WebGL frameworks and libraries
View WebGL-frameworks-libraries.md

A non-exhaustive list of WebGL frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are outdated/not maintained anymore.

Engines and libraries

  • three.js: JavaScript 3D library
  • stack.gl: an open software ecosystem for WebGL, built on top of browserify and npm.
  • PixiJS: Super fast HTML 5 2D rendering engine that uses webGL with canvas fallback
  • Pex: Pex is a javascript 3d library / engine allowing for seamless development between Plask and WebGL in the browser.
  • Babylon.js: a complete JavaScript framework for building 3D games with HTML 5 and WebGL
  • SceneJS: An extensible WebGL-based engine for high-detail 3D visualisation
  • Blend4Web: a tool for interactive 3D visualization on the Internet
@zjhiphop
zjhiphop / tcp-socketio-sample.js
Created Sep 18, 2017 — forked from maripiyoko/tcp-socketio-sample.js
Node.js Tcp server & Socket.io
View tcp-socketio-sample.js
// socket io
var app = require('http').createServer(handler),
io = require('socket.io').listen(app),
fs = require('fs');
app.listen(3000, function() {
console.log('Socket IO Server is listening on port 3000');
});
function handler(req, res) {
@zjhiphop
zjhiphop / RestServer.php
Created Aug 30, 2017 — forked from jasdeepkhalsa/RestServer.php
Simple PHP REST / JSON Server with example.php by Jake Sankey (http://jakesankey.com/blog/2012/09/php-simple-rest-server/)
View RestServer.php
<?php
class RestServer
{
public $serviceClass;
public function __construct($serviceClass)
{
$this->serviceClass = $serviceClass;
}
@zjhiphop
zjhiphop / gist:872ec0cd0ccaf6b5ac7d5bc880f8ab13
Created Apr 20, 2017 — forked from Faithree/gist:f8b84de4a300a6a42c2f4a1a46a08872
关于vue+node前后端分离,前端跨域的方案
View gist:872ec0cd0ccaf6b5ac7d5bc880f8ab13
昨天在做登陆请求的时候,脑子一抽,想试试原生的ajax来请求后台,这时候我就写下了下面的代码,
```
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status >= 200 && xhr.status < 300 || xhr.status == 304) {
console.log(xhr.responseText)
} else {
//错误处理
View avoiding-exceptions.js
/**
* WHY? - BECAUSE EXCEPTIONS/TRY/CATCH IS A GLOBAL HORRIBLE MESS :-(
* Check out error handling in golang: https://blog.golang.org/error-handling-and-go
*/
/**
* Wrap an "unsafe" promise
*/
function safePromise(promise) {
return promise
@zjhiphop
zjhiphop / nginx_config.md
Created Nov 7, 2016 — forked from Mioke/nginx_config.md
Mac OS下安装及配置nginx
View nginx_config.md
View es6.md
View 5 minute local Kubernetes Cluster on Mac
# Reference:
https://www.cloudgear.net/blog/2015/5-minutes-kubernetes-setup/
# install homebrew and cask
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install virtualbox
brew cask install virtualbox
# install dockertoolbox
View Webpack 2.0.7-beta vs Rollup
❯ rollup --version
rollup version 0.25.3
❯ time rollup -c ./rollup.js
rollup -c ./rollup.js 4.65s user 0.22s system 118% cpu 4.131 total
❯ time webpack
Hash: ebb00bbccd954c114d3c
Version: webpack 2.0.7-beta
Time: 3623ms
View docker-clean.sh
#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs docker rm -v
# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs docker rmi
# remove unused volumes:
docker volume ls -qf dangling=true | xargs docker volume rm