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 / main.dart
Created November 21, 2023 14:44
Counter example
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@Phinome
Phinome / geo.json
Created January 11, 2022 12:56
geo json
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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 / ecursively-change-file-extensions-in-bash.sh
Created July 16, 2018 08:51
recursively-change-file-extensions-in-bash
find . -name "*.t1" -exec bash -c 'mv "$1" "${1%.t1}".t2' - '{}' \;
@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 / grf.sh
Last active January 20, 2017 09:51
rewrite git commitor shell
git filter-branch --env-filter '
OLD_EMAIL="xxx@example.com"
CORRECT_NAME="yyy"
CORRECT_EMAIL="yyy@new.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$CORRECT_NAME"
export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL"
@Phinome
Phinome / cssTooltip.html
Created November 30, 2016 07:19
css tooltip
<!-- from: https://jsfiddle.net/greypants/zgCb7/ -->
<style>
.wrapper {
text-transform: uppercase;
background: #ececec;
color: #555;
cursor: help;
font-family: "Gill Sans", Impact, sans-serif;
font-size: 20px;
margin: 0;
@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 ...
<style>
.wrap {
margin: 0;
padding: 0 13px;
}
.item {
position: relative;
margin: 0;
padding-bottom: 10px;
border-left: 2px solid #82c64f;