2018年:
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 { ajax, AjaxConfig, AjaxResponse } from 'rxjs/ajax'; | |
import { from, Observable, of, OperatorFunction, switchMap } from 'rxjs'; | |
export type BeforeInterceptors = (config: AjaxConfig) => Promise<AjaxConfig> | AjaxConfig | Observable<AjaxConfig>; | |
export type AfterInterceptors<T extends any = any> = (response: AjaxResponse<T>) => Observable<AjaxResponse<T>> | AjaxResponse<T> | Promise<AjaxResponse<T>>; | |
const BEFORE_INTERCEPTORS: BeforeInterceptors[] = []; | |
const AFTER_INTERCEPTORS: AfterInterceptors[] = []; | |
interface ConfigInterceptor { |
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
http -v -j POST https://hkt-mobile-api.nowtv.now.com/09/1/getLiveURL mode=prod format=HLS callerReferenceNo=20190707123320 channelno=332 deviceType=5 deviceId=7634de3e186676d537OA | |
http -v -j POST https://api.viu.now.com/p8/2/getLiveURL mode=prod format=HLS callerReferenceNo=20190707123320 channelno=100 deviceType=5 deviceId=7634de3e186676d537 |
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
#!/bin/sh | |
sudo ps aux | grep Netskope | grep -v grep | awk '{ print "kill -9", $2 }' | sudo sh | |
echo '[✓] Kill Netskope Process' | |
sudo rm -rf /Applications/Remove\ Netskope\ Client.app | |
echo '[✓] Removed Remove Netskope Client.app' | |
sudo rm -rf /Library/Application\ Support/Netskope | |
echo '[✓] Removed Agent of Netskope Client.app' |
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
module.exports = async function getDevDependencies(globs = ['package.json', 'packages/*/*.json']) { | |
const globby = require('globby'); | |
const packageFiles = await globby(globs, { absolute: true }); | |
return packageFiles.reduce((result, file) => { | |
const pkg = require(file); | |
if (pkg.devDependencies) { | |
const names = Object.keys(pkg.devDependencies); | |
return result.concat(names.filter(name => !result.includes(name))); | |
} |
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 (context, trackingId, options) { | |
const history = context.history; | |
const doc = document; | |
const nav = navigator || {}; | |
const storage = localStorage; | |
const encode = encodeURIComponent; | |
const pushState = history.pushState; | |
const typeException = 'exception'; | |
const generateId = () => Math.random().toString(36); | |
const getId = () => { |
This content moved here: https://exploringjs.com/impatient-js/ch_arrays.html#quickref-arrays
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 打开 https://m.weibo.cn/beta 登陆你被炸的账号 | |
* 2 打开浏览器控制台 | |
**/ | |
function delay (time) { | |
return new Promise(r => { | |
setTimeout(() => r(), time || 1000); // 延时 1s,可适当增加延长时间 | |
}); | |
} |
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
const waitFor = (ms) => new Promise(r => setTimeout(r, ms)) | |
const asyncForEach = async (array, callback) => { | |
for (let index = 0; index < array.length; index++) { | |
await callback(array[index], index, array) | |
} | |
} | |
const start = async () => { | |
await asyncForEach([1, 2, 3], async (num) => { | |
await waitFor(50) |
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
/** | |
* Get Local IP Address | |
* | |
* @returns Promise Object | |
* | |
* getLocalIP().then((ipAddr) => { | |
* console.log(ipAddr); // 192.168.0.122 | |
* }); | |
*/ | |
function getLocalIP() { |
NewerOlder