Skip to content

Instantly share code, notes, and snippets.

@mindevolution
mindevolution / script.sh
Last active February 26, 2020 08:26
Docker in mac build node with node-sass
# https://github.com/sass/node-sass/issues/2165
docker pull node
# cd to working dir
# start docker
docker run -it -v $PWD:/code -p 3001:3000 node bash
npm i -g n
n 8.10.0
@mindevolution
mindevolution / wfcaltulateTotal.js
Created February 14, 2020 02:52
Calculate data for browser table
let calculateEachMonth = () => {
const data = {};
const dataYear = {};
document.querySelectorAll('#list > div > table > tbody > tr').forEach(row => {
const dateCell = row.querySelector('td:nth-child(1)').innerHTML;
const money = Number(row.querySelector('td:nth-child(2)').innerHTML.replace(/[^0-9\.]/g, ''));
const yearMonth = 'T' + dateCell.replace(/月.*/g, '').replace(/ /, '');
const year = 'T' + dateCell.replace(/ \d*月.*/g, '');
if (data[yearMonth]) {
data[yearMonth] += money;
@mindevolution
mindevolution / config.json
Last active February 8, 2020 06:01
v2ray server, client install
{
"inbounds": [
{
"port": 1080, // Listening port
"protocol": "socks", // Incoming protocol is SOCKS 5
"sniffing": {
"enabled": true,
"destOverride": ["http", "tls"]
},
"settings": {
const curry = fn => {
if (fn.length <= 1) return fn;
const generator = (...args) => {
if (fn.length === args.length) {
return fn(...args);
} else {
return (...args2) => generator(...args, ...args2);
}
};
return generator;
import React from 'react';
export default class RequestTest extends React.PureComponent {
constructor(props, context) {
super(props);
this.state = {
pageSize: 500,
concurrent: true,
concurrentNumber: 5,
@mindevolution
mindevolution / dabblet.css
Last active March 5, 2019 07:00
Box triangle with shadow box
/**
* Box triangle with shadow box
*/
.ant-dropdown-placement-bottomLeft ul {
box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
position: relative;
top: 20px;
left: 20px;
width: 100px
}
@mindevolution
mindevolution / Instructions.sh
Created August 20, 2018 14:26 — forked from GhazanfarMir/Instructions.sh
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
@mindevolution
mindevolution / gist:d4ccd893e0ea3e64911431fee597eedb
Created July 27, 2018 02:28 — forked from jordelver/gist:3073101
Set the Mac OS X SOCKS proxy on the command line

Set the Mac OS X SOCKS proxy on the command line

a.k.a. what to do when your ISP starts blocking sites :(

Set the SOCKS proxy to local SSH tunnel

networksetup -setsocksfirewallproxy "Ethernet" localhost 8080

To clear the domain and port

@mindevolution
mindevolution / php-db-test.php
Last active June 6, 2018 06:38
Test php mysql db connection
<?php
$servername = '127.0.0.1';
$username = 'dbuser';
$password = 'dbpassword';
$dbname = 'dbname';
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
@mindevolution
mindevolution / git-unchanged.sh
Created September 27, 2017 04:17
git set assume unchanged by directory
git ls-files -z | xargs -0 git update-index --assume-unchanged