Skip to content

Instantly share code, notes, and snippets.

@sudsy
sudsy / dabblet.css
Created April 17, 2012 05:08
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
.container {
background-color: red;
min-height:100px;
}
.element {
@sudsy
sudsy / dabblet.css
Created April 17, 2012 05:47
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
.container {
background-color: red;
}
.left {
float: left;;
@sudsy
sudsy / dabblet.css
Created April 17, 2012 05:58
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
.container {
height: 20px;
background-color: red;
overflow: hidden;
}
.left {
@sudsy
sudsy / dabblet.css
Created April 19, 2012 23:27
Expanding Text Box
/**
* Expanding Text Box
*/
#parent {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
margin-left: 50px;
margin-right: 50px;
}
@sudsy
sudsy / trycatchperformance
Last active December 22, 2015 16:49
Performance Testing of asynchronous functions using try catch blocks node.js see: http://www.lighthouselogic.com/try-catch-performance-in-node-js/
var Benchmark = require('benchmark');
var fs = require("fs");
var j_ = 10000000;
function intensive(){
var s = 0;
for (var i = 0; i < j_; i++) s = i;
var Benchmark = require('benchmark');
var fs = require("fs");
var domain = require("domain");
var d = domain.create().on('error', function(err){ console.log("Caught" + err); process.exit();})
var j_ = 10000000;
function intensive(){
@sudsy
sudsy / nodeinternaldomain
Created September 10, 2013 00:46
Testing performance of node async functions with internal domains see: http://www.lighthouselogic.com/using-a-new-domain-for-each-async-function-in-node/
var Benchmark = require('benchmark');
var fs = require("fs");
var domain = require("domain");
var d = domain.create().on('error', function(err){ console.log("Caught" + err); process.exit();})
var j_ = 10000000;
function intensive(){
@sudsy
sudsy / caught.js
Last active December 26, 2015 13:59 — forked from owenallenaz/caught.js
Showing that node.js domains do catch synchronous errors (caught.js). Showing that try catch can interfere with nodejs domains (notcaught.js).
var domain = require("domain");
var d = domain.create();
d.on("error", function() {
console.log("domain caught");
});
d.run(function() {
throw new Error("foo");
.done {
opacity: 0.5;
text-decoration: line-through;
}
P: /devices/LNXSYSTM:00
E: DEVPATH=/devices/LNXSYSTM:00
E: MODALIAS=acpi:LNXSYSTM:
E: SUBSYSTEM=acpi
P: /devices/LNXSYSTM:00/ICV0A12:00
E: DEVPATH=/devices/LNXSYSTM:00/ICV0A12:00
E: ID_VENDOR_FROM_DATABASE=Inside Contactless
E: MODALIAS=acpi:ICV0A12:
E: SUBSYSTEM=acpi