Skip to content

Instantly share code, notes, and snippets.

@lwdgit
lwdgit / main.go
Created December 4, 2022 15:37 — forked from planetA/main.go
test-runc
package main
import (
"fmt"
"golang.org/x/sys/unix"
"log"
"os"
"runtime"
"github.com/opencontainers/runc/libcontainer"
@lwdgit
lwdgit / 0_reuse_code.js
Created July 16, 2016 07:21
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
function* wrap() {
yield sleep(1000);
yield sleep(2000);
}
function sleep(time) {
return function(done) {
setTimeout(function() {
console.log('sleep ' + time + 'ms');
done(null, time);
function testWebP(callback) {
var webP = new Image();
webP.src =
'data:image/webp;base64,UklGRjoAAABXRUJQVlA4IC4AAACyAgCdASoCAAIALmk0mk0iIiIiIgBoSygABc6WWgAA/veff/0PP8bA//LwYAAA';
webP.onload = webP.onerror = function() {
typeof callback === 'function' && callback(webP.height === 2);
};
};
testWebP(function(supported) {
console.log(supported);
[].forEach.call($$("*"),function(a){
a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)
})