Skip to content

Instantly share code, notes, and snippets.

@semlinker
semlinker / index.html
Last active June 4, 2023 07:10
Axios 取消重复请求
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Axios 取消重复请求示例</title>
<script src="https://cdn.bootcdn.net/ajax/libs/qs/6.9.6/qs.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
</head>
@fikryfahrezy
fikryfahrezy / awesome-github-repo.md
Last active March 6, 2022 23:51
Awesome GitHub Repo
@qingant
qingant / range.js
Last active October 10, 2022 12:35
// Problem Set below:
// Task: Implement a class named 'RangeList'
// A pair of integers define a range, for example: [1, 5). This range includes integers: 1, 2, 3, and 4.
// A range list is an aggregate of these ranges: [1, 5), [10, 11), [100, 201)
/*
RangeList is a strict ordered range list:
1. For any [a, b] in RangeList, a < b
2. For any [a1, b1], [a2, b2] in RangeList with index i, j, given i < j, a1 < b1 < a2 < b2
@mr-parus
mr-parus / description.txt
Last active January 9, 2024 12:36
[JS] Alphabetic Anagrams
Task from Codewars: https://www.codewars.com/kata/53e57dada0cb0400ba000688/train/javascript
Consider a "word" as any sequence of capital letters A-Z (not limited to just "dictionary words"). For any word with at least two different letters, there are other words composed of the same letters but in a different order (for instance, STATIONARILY/ANTIROYALIST, which happen to both be dictionary words; for our purposes "AAIILNORSTTY" is also a "word" composed of the same letters as these two).
We can then assign a number to every word, based on where it falls in an alphabetically sorted list of all words made up of the same group of letters. One way to do this would be to generate the entire list of words and find the desired one, but this would be slow if the word is long.
Given a word, return its number. Your function should be able to accept any word 25 letters or less in length (possibly with some letters repeated), and take no more than 500 milliseconds to run. To compare, when the solution code runs the 2
# Unix (Terminal)
open -a "Google Chrome" --args --disable-gpu-vsync --disable-frame-rate-limit
# Windows (Command prompt)
start chrome --args --disable-gpu-vsync --disable-frame-rate-limit
@yougg
yougg / proxy.md
Last active May 23, 2024 11:36
complete ways to set http/socks/ssh proxy environment variables

set http or socks proxy environment variables

# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT

# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT

# set http proxy with user and password (with special characters)
@DmitrySoshnikov
DmitrySoshnikov / event-loop.js
Last active December 14, 2023 23:23
Event loop
/**
* Event loop.
*
* Read details here:
* http://dmitrysoshnikov.com/ecmascript/javascript-the-core-2nd-edition/#job
*
* by Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
*/
/**
@samzeng
samzeng / reset-mobile.css
Last active July 11, 2019 04:54
reset CSS for mobile browsers
@charset "utf-8";
html {
color: #000;
background: #fff;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%
}
html * {
outline: 0;
@equinoxel
equinoxel / main.scss
Created January 23, 2017 10:37
webpack 2 config capable of loading font-awesome fonts
@import "~normalize-scss/sass/normalize";
$fa-font-path: "~font-awesome/fonts";
@import "~font-awesome/scss/font-awesome.scss";
@import "bourbon";
import * as path from 'path';
import * as ExtractTextPlugin from 'extract-text-webpack-plugin';
import * as AssetsPlugin from 'assets-webpack-plugin';
import * as CompressionPlugin from 'compression-webpack-plugin';
import * as CopyWebpackPlugin from 'copy-webpack-plugin';
import * as ManifestPlugin from 'webpack-manifest-plugin';
import * as webpack from 'webpack';
import { clientConfiguration, serverConfiguration } from 'universal-webpack';
import settings from './universal-webpack-settings';