/etc/network/interfaces
append the following line:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto eth0
/etc/network/interfaces
append the following line:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto eth0
I hereby claim:
To claim this, I am signing this object:
/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ | |
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | |
/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, | |
* if you want the limit (max/min) macros for int types. | |
*/ | |
#ifndef __STDC_LIMIT_MACROS | |
#define __STDC_LIMIT_MACROS 1 | |
#endif |
var b = new Promise(function (resolve, reject) { | |
setTimeout(function(){ | |
reject(new Error("haha"));}) | |
}); | |
b.then(function(v){ | |
console.log(v); return 3; | |
}, function(e) { | |
console.log("error: " + e); | |
}).then(function(v){ |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style> | |
.circle { | |
width: 100px; | |
height: 100px; |
<style> | |
.b { | |
width: 100px; | |
height: 100px; | |
background-color: blue; | |
margin-top: -30px; | |
} | |
.b-child { | |
width: 50px; | |
height: 50px; |
#!/usr/bin/env ruby | |
# -*- encoding: UTF-8 -*- | |
class Base | |
attr_reader :blocks | |
class << self | |
def get(path, &block) | |
@blocks ||= [] | |
@blocks << block |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout. This is also called reflow or layout thrashing, and is common performance bottleneck.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
elem.clientLeft
, elem.clientTop
, elem.clientWidth
, elem.clientHeight
elem.getClientRects()
, elem.getBoundingClientRect()
var emojiSupported = (function() { | |
var node = document.createElement('canvas'); | |
if (!node.getContext || !node.getContext('2d') || | |
typeof node.getContext('2d').fillText !== 'function') | |
return false; | |
var ctx = node.getContext('2d'); | |
ctx.textBaseline = 'top'; | |
ctx.font = '32px Arial'; | |
ctx.fillText('\ud83d\ude03', 0, 0); | |
return ctx.getImageData(16, 16, 1, 1).data[0] !== 0; |