Skip to content

Instantly share code, notes, and snippets.

@whatwewant
whatwewant / lima-on-m1-mac-installation-guide.md
Created October 17, 2021 11:04 — forked from toricls/lima-on-m1-mac-installation-guide.md
Using Lima to run containers with containerd and nerdctl (without Docker Desktop) on M1 Macs

Lima (Linux virtual machines, on macOS) installation guide for M1 Mac.

Sep. 27th 2021 UPDATED

Now we can install patched version of QEMU via Homebrew (thank you everyone for the info!). Here is the updated instruction with it:

Used M1 Mac mini 2020 with macOS Big Sur Version 11.6.

1. Install QEMU & Lima

/*jslint browser: true */
/*global jQuery */
var Bridge = (function (window, jQuery) {
"use strict";
var Bridge;
Bridge = {
callbackId: 0,

keep-alive

是什么

  • 省略

为什么

  • 1 keep-alive 目的是在过期时间内保持浏览器端与服务器端间的连接
  • 2 是TCP层面的,保持TCP连接不关闭,而不是保持http连接不关闭;
  • 3 keep-alive是串行的不是并行的;
@whatwewant
whatwewant / Movable-On-Body.js
Last active May 16, 2018 05:59
enable element move anywhere on browser
function isSupportPassive() {
let isSupport = false;
try {
const opts = Object.defineProperty({}, 'passive', {
get() {
isSupport = true;
},
});
window.addEventListener('test', null, opts);
} catch (e) {
const callback = () => console.log('done');
const getStatus = () => !!Math.round(Math.random());
const delay = ms => new Promise(resolve => setTimeout(resolve, ms));
function polling(getStatus, callback) {
let delta = 1000;
let start;
return async function idle() {
if (getStatus()) {
@whatwewant
whatwewant / correct_git_user.sh
Created May 29, 2017 09:45
修改git全部已提交的用户名和邮箱
// @from http://dangzhiqiang.blog.51cto.com/7961271/1657864
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
## Adobe PhotoShop CC 2017安装包汉化
* 下载:[zh_CN.zip](https://pan.baidu.com/s/1jHCfU4m)
* 密码:i9ud
* 语言包安装方法:
* 1 安装好photoshop以后,将解压好的语言包文件夹复制到 应用程序/Adobe Photoshop CC 2017/Locales 目录下
* 2 打开 photoshop,点击左上角 Photoshop CC/Preferences/Interface... 在弹出的界面中间部分修改UI Language的值 为Simplified Chinese 点击右上角 OK按钮。
* 3 重启 photoshop 即可。

如果你学过Angular或者熟悉函数式编程,你可能对 RxJs 实现的 Observable 概念十分熟悉。本文是在Vue中使用RxJS的快速预览。 If you come from Angular-land or are a fan of functional programming, you’re probably pretty familiar with the concept of observable streams, as implemented most commonly in JS-land by RxJS. Here’s a quick guide on using RxJS with Vue.

安装

Installation

现在,可能不像其他框架一样,RxJS拥有官方插件支持 -- vue-rx,它满足了所有的需求。 Now, Vue doesn’t come with RxJS support out-of-the-box like other frameworks might, but it does provide an official plugin, vue-rx that adds the needed bindings.

为了使用它,你需要先用 Yarn 或 NPM 安装 vue-rx。

<div class="eui_modal" style="position: fixed; top: 0px; right: 0px; bottom: 0px; left: 0px;">
<div class="eui_mask" style="position: fixed; top: 0px; right: 0px; bottom: 0px; left: 0px; z-index: 1040; background-color: rgba(0, 0, 0, 1); opacity: 0.5;"></div>
<div style="width: 100%; margin: 0rem auto; z-index: 1040; outline: 0px;">
<div style="width: 50%; margin: 3rem auto; min-width: 10rem;">
<div style="position: relative; background-color: rgb(45, 48, 57); border: 1px solid rgba(0, 0, 0, 0.2); box-shadow: rgba(0, 0, 0, 0.498039) 0px 5px 15px; border-radius: 0.25rem; background-clip: padding-box; outline: 0px; z-index: 1060;">
<div class="eui_modal_header" style="padding: 0 1rem; border-bottom: 1px solid rgb(65, 72, 87); color: rgb(82, 121, 143);">
<button style="display: inline-block; padding: 0px; cursor: pointer; background: transparent; border: 0px; -webkit-appearance: none; float: right; font-size: 2rem; font-weight: 400; line-height: 1;
var path = require('path');
// get browser path
var indexPage = (function () {
var args = (function () {
return process.env.npm_config_argv ? JSON.parse(process.env.npm_config_argv).original : null;
})() || process.argv;
for (i in args) {
if (args[i] === '--index' && args[parseInt(i) + 1]) {
var indexString = args[parseInt(i) + 1];