This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
(() => { | |
const SHOW_SIDES = false; // color sides of DOM nodes? | |
const COLOR_SURFACE = true; // color tops of DOM nodes? | |
const COLOR_RANDOM = false; // randomise color? | |
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
const THICKNESS = 20; // thickness of layers | |
const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 | LAFBD-41 | |
---|---|---|
2 | SSNI-497 | |
3 | ABP-984 | |
4 | IPX-580 | |
5 | IPX-811 | |
6 | IPX-177 | |
7 | STARS-804 | |
8 | SMBD-115 | |
9 | ABP-968 | |
10 | ABF-017 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AppStoreUpdate.swift | |
// | |
// Created by CodeChanger on 03/11/19. | |
// Copyright © 2019 CodeChanger. All rights reserved. | |
// | |
import UIKit | |
enum CustomError: Error { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { __RouterContext as RouterContext, RouteComponentProps } from 'react-router' | |
import { useContext, useMemo, useCallback } from 'react' | |
import qs from 'qs' | |
import { Location } from 'history' | |
interface ParsedQuery { | |
[whatever: string]: any | |
} | |
export const useRouter = <T>(): RouteComponentProps<T> => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a coding exercise of implementing a parser. Some minor parsing capabilities are not implemented. | |
// The algorithm are mainly from Douglas Crockford's 'https://github.com/douglascrockford/JSON-js/blob/master/json_parse.js' | |
function json_parse(str) { | |
var i = 0 | |
var ch = str[i] | |
// core function that recursively called to move forward scanning pointers and accept tokens | |
function next(c) { | |
if (c) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xcodebuild -workspace XXX.xcworkspace -scheme XXX clean build OTHER_SWIFT_FLAGS="-Xfrontend -debug-time-function-bodies" | grep '^\d\{3,\}[.]\{1\}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function convertToCSV(objArray) { | |
var array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray; | |
var str = ''; | |
for (var i = 0; i < array.length; i++) { | |
var line = ''; | |
for (var index in array[i]) { | |
if (line != '') line += ',' | |
line += array[i][index]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
/** | |
* 记录方法使用情况的类 | |
* @param {Array.<boolean>} umMap 初始的使用情况 | |
*/ | |
var UsageManager = function(umMap) { | |
this.umMap = umMap || []; | |
}; | |
/** | |
* 记录新的使用情况 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2016-2018 Ming Qin (覃明) <https://github.com/QinMing> | |
# Open source under MIT LICENSE. | |
lazy_load() { | |
# Act as a stub to another shell function/command. When first run, it will load the actual function/command then execute it. | |
# E.g. This made my zsh load 0.8 seconds faster by loading `nvm` when "nvm", "npm" or "node" is used for the first time | |
# $1: space separated list of alias to release after the first load | |
# $2: file to source | |
# $3: name of the command to run after it's loaded | |
# $4+: argv to be passed to $3 |
NewerOlder