Skip to content

Instantly share code, notes, and snippets.

View Phinome's full-sized avatar
🤒
Out sick

Phinome Phinome

🤒
Out sick
  • China
View GitHub Profile
@Phinome
Phinome / App.js
Created May 27, 2019 13:49 — forked from shelldandy/App.js
nprogress with react-router in create-react-app
import React from 'react'
import { BrowserRouter as Router, Switch } from 'react-router-dom'
import routes from './routes'
import FancyRoute from './components/tools/FancyRoute'
const App = props =>
<Router>
<Switch>
{routes.map((route, i) =>
<FancyRoute key={i} {...route} />
@Phinome
Phinome / nginx-tuning.md
Created April 27, 2018 03:11 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@Phinome
Phinome / Xcode 文件下载.md
Created November 29, 2016 08:53 — forked from mr-pinzhang/Xcode 文件下载.md
Xcode 文件下载

在 Xcode 里下载文件真的是一种折磨, 特别是每次 Xcode 大版本更新都会遇到新的下载内容. 经过一翻周折, 本人找到一个方法可以轻松快速便捷地下载和安装对应的 Simulator 和 Doc 文件

  1. 在 Mac 下, 打开 Xcode, 进入 Preference 中的 Downloads 面板
  2. 点击任意的下载按钮
  3. 打开系统帮助工具 Console
  4. 稍等一会儿, 在 Xcode 里取消下载, 然后你会在 Console 里面看到对应的下载地址 (对应的 Cosnole Message 是 (DVTDownloadable: Download Cancelled. Downloadable: ...) 之类的)
  5. 复制对应的链接地址, 到某雷或者任何比 Xcode 下载快的工具里
  6. 等待下载完成, 进入 /Users/#{Username}/Library/Caches
@Phinome
Phinome / ip.js
Created October 15, 2016 05:19 — forked from szalishchuk/ip.js
Get local external ip address with nodejs
var
// Local ip address that we're trying to calculate
address
// Provides a few basic operating-system related utility functions (built-in)
,os = require('os')
// Network interfaces
,ifaces = os.networkInterfaces();
// Iterate over interfaces ...
@Phinome
Phinome / index.html
Created August 11, 2015 08:39 — forked from anonymous/index.html
Promise race excute // source https://jsbin.com/baxefi
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Promise race excute</title>
</head>
<body>
<script id="jsbin-javascript">
// `delay`毫秒后执行resolve
@Phinome
Phinome / index.html
Created August 11, 2015 08:21 — forked from anonymous/index.html
Promise all excute // source https://jsbin.com/qivujag
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Promise all excute</title>
</head>
<body>
<script id="jsbin-javascript">
// `delay`毫秒后执行resolve
@Phinome
Phinome / index.html
Created August 11, 2015 07:43 — forked from anonymous/index.html
Promise then parallel code style // source https://jsbin.com/digaxa
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<meta charset="utf-8">
<title>Promise then parallel code style</title>
<style id="jsbin-css">
.demo{
color: red;
}
@Phinome
Phinome / index.html
Created August 11, 2015 06:42 — forked from anonymous/index.html
caback hell // source https://jsbin.com/fusehu
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>caback hell</title>
</head>
<body>
<div id="wrap"></div>
<script id="jsbin-javascript">
var login,
@Phinome
Phinome / index.html
Created August 11, 2015 06:40 — forked from anonymous/index.html
cannot catch async error // source https://jsbin.com/fiqowo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>cannot catch async error</title>
</head>
<body>
<div id="wrap"></div>
<script id="jsbin-javascript">
var login,
@Phinome
Phinome / index.html
Created August 11, 2015 06:31 — forked from anonymous/index.html
Promise then code style // source https://jsbin.com/kerapi
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Promise then code style</title>
</head>
<body>
<div id="wrap"></div>
<script id="jsbin-javascript">
var login = function(isLogin) {