Skip to content

Instantly share code, notes, and snippets.

View ystarlongzi's full-sized avatar
🎱
Focusing

流采 ystarlongzi

🎱
Focusing
  • Tuya
  • HangZhou
View GitHub Profile
@maxca
maxca / mysql-redis-docker-compose.yml
Created December 13, 2018 08:32
mysql-redis-docker-compose.yml
version: '2.3'
services:
mysql:
restart: always
image: mariadb:10.3
container_name: mariadb
ports:
- "3307:3306"
volumes:
@Lucifier129
Lucifier129 / Revue.js
Last active June 7, 2017 02:02
Make React.js code look like Vue.js
import React from 'react'
import ReactDOM from 'react-dom'
function createStore(actions, initialState={}) {
let currentState = initialState
let getState = () => currentState
let listeners = []
let subscribe = listener => !listeners.includes(listener) && listeners.push(listener)
let publish = () => listeners.forEach(listener => listener())
let dispatch = (type, payload) => {
@rambolee
rambolee / update-dnsmasq-from-gfwlist.py
Last active May 2, 2024 01:27
升级 小米路由器3 可以ssh 可以 Shadowsocks [Tags]: 小米路由, 小米路由3, 小米路由器, 小米路由器3, ssh, shadowsocks
#!/usr/bin/env python
#coding=utf-8
#
# Generate a list of dnsmasq rules with ipset for gfwlist
#
# Copyright (C) 2014 http://www.shuyz.com
# Ref https://code.google.com/p/autoproxy-gfwlist/wiki/Rules
import urllib2
import re
@joshnuss
joshnuss / app.js
Last active March 4, 2024 00:01
Express.js role-based permissions middleware
// the main app file
import express from "express";
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db)
import authenticate from "./authentication"; // middleware for doing authentication
import permit from "./authorization"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection
/**
* impress.js
*
* impress.js is a presentation tool based on the power of CSS3 transforms and transitions
* in modern browsers and inspired by the idea behind prezi.com.
*
*
* Copyright 2011-2012 Bartek Szopka (@bartaz)
*
* Released under the MIT and GPL Licenses.