Skip to content

Instantly share code, notes, and snippets.

View malash's full-sized avatar
:octocat:
Open-source

Malash malash

:octocat:
Open-source
View GitHub Profile
@malash
malash / ordered-json.js
Created October 10, 2015 10:48
实现了有序的JSON格式化的AngularJS过滤器,排序使用字典序
'use strict';
angular.module('metrics').filter('orderedJson', [
function () {
return function (data) {
function _json(d) {
var ret = '';
var k;
var value;
if (!angular.isObject(d) && !angular.isArray(d)) {
@malash
malash / fxxking-alipay-chrome-https-issue.sh
Last active April 11, 2018 06:26
修复Chrome在macOS Seirra下因支付宝造成HTTPS失败的问题
# 官方:https://bugs.chromium.org/p/chromium/issues/detail?id=649253
# 相关1:http://gold.xitu.io/entry/5800318e7db2a200597bff78
# 相关2:https://twiceyuan.com/2016/09/26/sierra-chrome-bug/
# 相关3:https://www.v2ex.com/t/307911
sudo launchctl remove com.alipay.DispatcherService
sudo rm -rf /Library/Application\ Support/Alipay && \
sudo rm -rf /Library/LaunchDaemons/com.alipay.DispatcherService.plist && \
sudo rm -rf ~/Library/LaunchAgents/com.alipay.adaptor.plist && \
sudo rm -rf ~/Library/LaunchAgents/com.alipay.refresher.plist && \
@malash
malash / bash.md
Last active May 15, 2017 03:59
Bugs on Bash on Ubuntu on Windows

NginX

NginX pwritev

NginX错误日志:

pwritev() "/var/lib/nginx/proxy/6/00/0000000006" failed (38: Function not implemented) while reading upstream
@malash
malash / kms.md
Last active October 27, 2024 08:42
kms.malash.net

Microsoft KMS Activation

Usage

Start a Command Prompt as an Administrator.

Windows

slmgr.vbs -ipk NPPR9-FWDCX-D2C8J-H872K-2YT43
slmgr.vbs -skms kms.malash.net
@malash
malash / interview.md
Last active January 11, 2018 03:12
常用面试JavaScript题目
function Test() {
  this.run = function() {
    console.log('run', this);
    setTimeout(this.run, 1000);
  }
}
const t = new Test();
t.run();
@malash
malash / shandong-jinan-chinanet-iptv.md
Last active March 18, 2025 18:31
山东济南电信IPTV+OpenWrt配置方法

山东济南电信IPTV+OpenWrt配置方法

适用

适用于:

  1. 光猫需要有telcomadmin权限
  2. 光猫不改桥接
  3. 光猫到路由器使用单线连接
@malash
malash / beijing-unicom-iptv.md
Created July 5, 2021 15:35
北京联通IPTV+OpenWrt配置方法
@malash
malash / concurrencyLimiter.ts
Last active December 5, 2021 05:06
A tiny concurrency limiter write with Promise and async function
export class ConcurrencyLimiter {
public constructor(private limit: number = Infinity) {}
private queue: Array<() => Promise<any>> = [];
private currentConcurrency = 0;
private async executeQueue() {
while (this.queue.length && this.currentConcurrency < this.limit) {
const tasks = this.queue.splice(0, this.limit - this.currentConcurrency);
@malash
malash / drag-to-fix-macos-app.sh
Last active November 23, 2024 09:03
Drag `.app` to this sheel to fix run issue for macOS
#!/bin/bash
echo "Drag \`.app\` to this shell or press enter to quit:"
echo -n "> "
read line
if [ -z "$line" ]; then
exit 0
fi
file=`realpath "$line"`