Skip to content

Instantly share code, notes, and snippets.

@WunGCQ
WunGCQ / check_function.js
Created February 27, 2017 16:16
javascript check css in html document loaded
function check(){
setTimeout(()=>(
var len = 0, arr = [],count = 0;
arr = Array.prototype.slice.call(document.head.children).filter(el=>((el.tagName == 'LINK'&& el.href) || (el.tagName == 'SCRIPT' && el.src))),len = arr.length,arr).forEach(e=>
e.addEventListener('load',()=>console.log(`finished ${++count} of ${len}`))),0);
}
@WunGCQ
WunGCQ / launch.json
Last active April 18, 2019 12:04
VSCode OSX C++ cpp tasks.json launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "C++ Launch (OSX)",
"type": "lldb",
"request": "launch",
"program": "${workspaceRoot}/Debug/out.o",
"MIMode": "lldb",
"stopAtEntry": false,
@WunGCQ
WunGCQ / 进制转换
Created June 3, 2016 10:43
实现一个小的进制转换器...
function log(a,b){
return Math.log(b)/Math.log(a);
}
function convert(_input, source, target) {
var input = _input.toString();
var I_L = source.length,T_L = target.length;
var len = input.length;
var num = input.split('').reduce((res,letter,i)=>{
var index = source.indexOf(letter);
@WunGCQ
WunGCQ / 0_reuse_code.js
Last active August 29, 2015 14:27
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console