Skip to content

Instantly share code, notes, and snippets.

View zhuzhuaicoding's full-sized avatar

zhuzhu_coder zhuzhuaicoding

View GitHub Profile
@kevincennis
kevincennis / v8.md
Last active January 11, 2026 23:59
V8 Installation and d8 shell usage

Installing V8 on a Mac

Prerequisites

  • Install Xcode (Avaliable on the Mac App Store)
  • Install Xcode Command Line Tools (Preferences > Downloads)
  • Install depot_tools
    • $ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
    • $ nano ~/.zshrc
    • Add path=('/path/to/depot_tools' $path)
@bluejava
bluejava / Soon
Last active December 22, 2022 06:27
A Very Fast Javascript thread yield (see blog posting)
// See http://www.bluejava.com/4NS/Speed-up-your-Websites-with-a-Faster-setTimeout-using-soon
// This is a very fast "asynchronous" flow control - i.e. it yields the thread and executes later,
// but not much later. It is far faster and lighter than using setTimeout(fn,0) for yielding threads.
// Its also faster than other setImmediate shims, as it uses Mutation Observer and "mainlines" successive
// calls internally.
// WARNING: This does not yield to the browser UI loop, so by using this repeatedly
// you can starve the UI and be unresponsive to the user.
// Note: For an even faster version, see https://gist.github.com/bluejava/b3eb39911da03a740727
var soon = (function() {
@overtrue
overtrue / gist:f540fbea3c33e3da53fd
Created January 12, 2015 09:23
移动端头部meta大全
<!DOCTYPE html> <!-- 使用 HTML5 doctype,不区分大小写 -->
<html lang="zh-cmn-Hans"> <!-- 更加标准的 lang 属性写法 http://zhi.hu/XyIa -->
<head>
<!-- 声明文档使用的字符编码 -->
<meta charset='utf-8'>
<!-- 优先使用 IE 最新版本和 Chrome -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<!-- 页面描述 -->
<meta name="description" content="不超过150个字符"/>
<!-- 页面关键词 -->
@couto
couto / webpack.js
Last active November 7, 2024 13:10
Fetch polyfill with webpack
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var path = require('path');
var folders = {
APP: path.resolve(__dirname, '../app'),
BUILD: path.resolve(__dirname, '../build'),
BOWER: path.resolve(__dirname, '../bower_components'),
NPM: path.resolve(__dirname, '../node_modules')
};
@DmitrySoshnikov
DmitrySoshnikov / asm-addr-mode.md
Last active May 13, 2025 12:22
Addressing modes in `mov`, and their C version
Addressing modes in mov, and their C version

Below are addressing modes (immediate, register, memory) on the examples of the mov assembly instruction. Here we use movl ("move long") for a 32-bit word.

Note: cannot move memory-to-memory, need two instructions.

Src
movl
@AnnaMag
AnnaMag / .lldbinit
Created January 20, 2017 12:15
helper functions to print V8 Objects
# lldb debugging v8-related functionality in Node.js
# =========================================================
# lldb re-write of user-defined V8 debugging functions
# https://github.com/v8/v8/blob/master/tools/gdbinit
#allow the file to be read when lldb starts (set to false to ignore it)
settings set target.load-cwd-lldbinit true
# Print HeapObjects.
@hefangshi
hefangshi / job.js
Created September 8, 2017 11:12
Job
/**
* Created Date: Friday, September 8th 2017, 6:50:56 pm
* Author: hefangshi
* Copyright (c) 2017 Baidu.Inc
*
*/
class Job {
constructor() {
this.running = 0;