Skip to content

Instantly share code, notes, and snippets.

View mercer08's full-sized avatar
🎯
Focusing

A mercer08

🎯
Focusing
View GitHub Profile
@shenqihui
shenqihui / README.md
Last active April 9, 2024 17:03
前端面试的笔试题

前端面试笔试题说明

出题的意义

  • 初步筛选出面试者,不用来一遍公司才发现不合适,节省面试者的时间。
  • 现场作答,由于面试者没带电脑,不方便作答,没法体现自己的能力。
  • 通过回答了的题目,提前判断出面试者的水平,节省面试的时间。
  • 让面试者充分准备。
@semlinker
semlinker / axios-retry-adapter.html
Created April 17, 2021 14:49
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/axios/0.21.1/axios.min.js"></script>
</head>
<body>
@t-io
t-io / osx_install.sh
Last active October 22, 2023 13:04
Install most of my Apps with homebrew & cask
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install and Set San Francisco as System Font
ruby -e "$(curl -fsSL https://raw.github.com/wellsriley/YosemiteSanFranciscoFont/master/install)"
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@remy
remy / gist:2484402
Created April 24, 2012 22:45
jquery.marquee.js
/**
* author Remy Sharp
* url http://remysharp.com/tag/marquee
*/
(function ($) {
$.fn.marquee = function (klass) {
var newMarquee = [],
last = this.length;
@kmaida
kmaida / convert-UNIX-timestamp.js
Last active March 16, 2023 09:31
Convert a UNIX timestamp to user's local time via JavaScript
function convertTimestamp(timestamp) {
var d = new Date(timestamp * 1000), // Convert the passed timestamp to milliseconds
yyyy = d.getFullYear(),
mm = ('0' + (d.getMonth() + 1)).slice(-2), // Months are zero based. Add leading 0.
dd = ('0' + d.getDate()).slice(-2), // Add leading 0.
hh = d.getHours(),
h = hh,
min = ('0' + d.getMinutes()).slice(-2), // Add leading 0.
ampm = 'AM',
time;
@guilhermepontes
guilhermepontes / readme.md
Last active November 27, 2022 21:02
Get the old VSCode back on macOS

Get the old VSCode icon back!! 🔥 🔥

First download the new old icon: https://cl.ly/mzTc (based on this)

You can also use the icon you want, but you need to convert it to .icns. You can use this service to convert PNG to ICNS.

Go to Applications and find VSCode, right click there and choose Get Info. Drag 'n drop the new icon.

@mbostock
mbostock / .block
Last active November 22, 2022 23:32
Line Transition
license: gpl-3.0
@z007
z007 / IdCard.txt
Created October 29, 2014 19:01
正则表达式Id card(身份证)验证
来源:http://www.cnblogs.com/devinhua/articles/1726292.html
1、简单的正则表达式:
(1)preg_match("/^(\d{18,18}|\d{15,15}|\d{17,17}x)$/",$id_card)
(2)preg_match("/^(\d{6})(18|19|20)?(\d{2})([01]\d)([0123]\d)(\d{3}) (\d|X)?$/",$id_card)
(3)preg_match("/(^\d{15}$/)|(\d{17}(?:\d|x|X)$/),$id_card)
@roshanca
roshanca / cacheUtils.js
Created July 3, 2019 06:08
cache utils #js #cache
const Cache = {
setCache (key, val) {
if (!this.isIncognitoMode()) {
if (val === null) {
localStorage.removeItem(key)
} else {
localStorage.setItem(key, JSON.stringify(val))
}
} else {
// 兼容隐身模式
@xiaojue
xiaojue / t.js
Last active August 29, 2019 06:46
countdown
/**
* @author xiaojue
* @date 20160420
* @fileoverview 倒计时
*/
(function() {
function timer(delay) {
this._queue = [];
this.stop = false;