Skip to content

Instantly share code, notes, and snippets.

View hangxingliu's full-sized avatar

Liu Yue hangxingliu

View GitHub Profile
@hangxingliu
hangxingliu / github-markdown-print.js
Created May 23, 2018 19:26
GitHub Markdown Print Script
// Refrence from: https://gist.github.com/beevelop/a0f2c76e79610dca01550c9a93f83876
// Copy following scripts in the developer console of page included markdown content you want to print:
(function () {
var $ = document.querySelector.bind(document);
$('#readme').setAttribute('style', 'position:absolute;top:0;left:0;right:0;bottom:0;z-index:100;background-color:white');
$('#readme>article').setAttribute('style', 'border: none');
$('body').innerHTML = $('#readme').outerHTML;
window.print();
})();
@hangxingliu
hangxingliu / install_babel_deps.js
Last active June 7, 2017 12:28
Install babel dependencies according to babelrc
#!/usr/bin/env node
//https://gist.github.com/hangxingliu/0b9604ef8ea5e11df36d8919613609be
let fs = require('fs'),
fatal = msg => console.error(`\n error: ${msg}\n`) + process.exit(1);
let babelrcPath = process.argv[2] || '.babelrc';
fs.existsSync(babelrcPath) || (
@hangxingliu
hangxingliu / Vagrantfile
Last active March 28, 2017 06:04
Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/xenial64"
# 不自动升级
config.vm.box_check_update = false
# 虚拟机内的8080 => 8080
config.vm.network "forwarded_port", guest: 8080, host: 8080
@hangxingliu
hangxingliu / fixVSCodeSolarizedColor.js
Last active July 22, 2023 09:51
A script for fix Solarized theme in VSCode from 1.12.0 looks like sxxt
#!/usr/bin/env node
//@ts-check
/// <reference types="node" />
// https://github.com/microsoft/vscode/blob/main/extensions/theme-solarized-light/themes/solarized-light-color-theme.json
const VERSION = "2023-07-22";
const AUTHOR = "Liu Yue <[email protected]>";
const IS_WINDOWS = process.platform == "win32";
const IS_OSX = process.platform == "darwin";
@hangxingliu
hangxingliu / cmder.reg
Created November 4, 2016 20:30
Add launch Cmder here to right click menu
Windows Registry Editor Version 5.00
; Remember change cmder path to your cmder installation path (and path separation should be use \\ to instead of \)
; 记得修改安装路径
[HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
""="Cmder"
"Icon"="G:\\DevTools\\cmder\\Cmder.exe"
@hangxingliu
hangxingliu / JSDOM.MD
Created May 22, 2016 19:32
JS原生DOM操作

Javascript原生DOM操作总结

Version : 1.0.0-16-04-05 Author : LiuYue

0.相关

nodeelement的父类(Element.nodeType 的值为 1)(node的子类还有TextNode,注释等). documentnode,但不是element

1.查找获得元素