Skip to content

Instantly share code, notes, and snippets.

View Flcwl's full-sized avatar
💭
want to balance

PR. Flcwl

💭
want to balance
View GitHub Profile
@Flcwl
Flcwl / math_util.js
Created July 2, 2021 02:17 — forked from A-limon/math_util.js
解决JavaScript浮点数计算的问题
;(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(factory);
} else if (typeof exports === 'object') {
module.exports = factory();
} else {
root._Math = factory();
}
}(this, function() {
var _Math = {
@Flcwl
Flcwl / serveStaticFiles.js
Created November 24, 2020 05:42 — forked from mitrakmt/serveStaticFiles.js
How to serve a static file in Node.js, without Express :)
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs"),
mime = require("mime")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
@Flcwl
Flcwl / webpack.config.js
Created October 1, 2020 10:49
Webpack Encore + Sass + MiniCSSExtractPlugin + PurgeCSS + OptimizeCss + Babel + Typescript
/* eslint-disable no-useless-escape */
const Encore = require('@symfony/webpack-encore');
const TerserPlugin = require('terser-webpack-plugin');
const CircularDependencyPlugin = require('circular-dependency-plugin');
const HtmlCriticalWebpackPlugin = require('html-critical-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const PurgeCssPlugin = require('purgecss-webpack-plugin');
const WebpackBar = require('webpackbar');
const path = require('path');
<div id="root">
<div class="container">
<Header class="header">Header</Header>
<div class="auto-fill">
auto fill <br />
auto fill <br />
auto fill <br />
auto fill <br />
auto fill <br />
@Flcwl
Flcwl / easing_functions
Created November 11, 2019 07:19 — forked from creotiv/easing_functions
Easing functions
/*
Easing Equations v1.5
May 1, 2003
(c) 2003 Robert Penner, all rights reserved.
This work is subject to the terms in http://www.robertpenner.com/easing_terms_of_use.html.
These tweening functions provide different flavors of
math-based motion under a consistent API.
Types of easing:
/** 设置input的placeholder样式 兼容性好法 */
@mixin input-placeholder($color: var(--black)) {
&::-webkit-input-placeholder {
color: $color;
}
&:-moz-placeholder {/* Firefox 18- */
color: $color;
}
&::-moz-placeholder {/* Firefox 19+ */
color: $color;
@Flcwl
Flcwl / es6-function-of-Array
Last active August 16, 2019 14:45
concatAll, map, filter, forEach
Array.prototype.forEach = function(cb) {
let len = this.length
for(let i = 0; i < len; i++) {
cb(this[i], i, this)
}
}
Array.prototype.concatAll = function() {
let ret = []
// [].push.apply(ret, item);