Skip to content

Instantly share code, notes, and snippets.

View SimpleZn's full-sized avatar

Simple.Z.N SimpleZn

  • 上海
View GitHub Profile
@davemo
davemo / api.proxy.server.js
Created November 6, 2012 21:56
A simple express.js server with a proxy that intercepts all requests with /api/ and proxies them to localhost:3000
var express = require('express'),
httpProxy = require('http-proxy'),
app = express();
var proxy = new httpProxy.RoutingProxy();
function apiProxy(host, port) {
return function(req, res, next) {
if(req.url.match(new RegExp('^\/api\/'))) {
proxy.proxyRequest(req, res, {host: host, port: port});
@spoike
spoike / reflux.js
Created June 29, 2014 22:23
A simpler implementation of React.JS's Flux
var EventEmitter = require('events').EventEmitter,
_ = require('lodash');
/**
* Creates an action functor object
*/
exports.createAction = function() {
var action = new EventEmitter(),
eventLabel = "action",
@matthewoden
matthewoden / Fullpage.js
Created June 24, 2015 00:37
How to set up server side rendering with react proxy loader, and avoid a checksum mismatch.
/*
So the above file here is my Full page react file. I do a couple things here:
- In the head, I inject my important CSS inline.
- In the body, I link to my commons chunk (with react, react-router, and anything that's going to be on every single page).
- Beneath that is the app entry file.
- Beneath that is a dynamically generated chunkfile, based on the current route.
Each of these are cachebusted with a hash, pulled from the webpack stats file.
*/
@arqex
arqex / formComponent.js
Created January 18, 2016 18:37
10.nonFunctionalReact
var MyForm = React.createClass({
render: function(){
return (
<ValidationForm ref="form" onSubmit={ this.validates }>
<Input name="title" validation="required" />
<Input name="age" validation="required,number" />
<Input name="email" validation={ value => value.match(/\S+@\S+\.\S+/) } />
</ValidationForm>
);
},
@inkss
inkss / #readme.md
Last active November 18, 2024 09:22
IPV6 直播源

个人向直播源

精简了上游直播源内容,仅保留个人所需的。

一、订阅地址

TVM3U

https://gist.githubusercontent.com/inkss/0cf33e9f52fbb1f91bc5eb0144e504cf/raw/ipv6.m3u