A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
One-line version to paste in your DevTools
Use $$
if your browser aliases it:
~ 108 byte version
function car() { | |
return { | |
start: function() { | |
console.log("Engine on.") | |
}, | |
accelerate: function() { | |
console.log("Let's go!") | |
} | |
} | |
} |
Interconnect: LAN(1GB) | |
Server: 12 core Xeon E5-2620 at 2Ghz, 16GB RAM | |
Client running on idle node with similar h/w configuration. Used latest wrk2 release | |
https://github.com/giltene/wrk2 | |
Tried different configuration options, results for configuration that gave best results | |
See also: https://gist.github.com/markpapadakis/dee39f95a404edfb8d6c | |
# Apache2: http://10.5.5.20/index.html | |
Requests/sec: 83704.15 | |
> More or less expected that kind of throughput |
// A simple LUT backed index for faster binary search, with LUT partition encoding | |
// A bloom filter can be attached to it, for when you have many, many values - though in practice | |
// it is rarely needed, especially if the bits(resolution) is over 16 | |
// | |
// You need (1 << bits) * sizeof(T::key) for the lut, e.g if T::key is uint32_t, for a 16bits LUT, that's | |
// 262k. Increasing resolution results in higher lookup efficiency, reducing it results in lower memory requirements | |
template<typename T> | |
static __attribute__((always_inline)) constexpr T MSB(const T n, const uint8_t span) | |
{ |
The MIT License (MIT) | |
Copyright (c) 2014 Tomas Kafka | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
// Ref: http://iaroslavski.narod.ru/quicksort/DualPivotQuicksort.pdf | |
template<typename T> | |
void DualPivotQuickSort(T *lo, T *hi, const std::function<int32_t(const T &, const T&)> &cmp) | |
{ | |
auto *const hiMinus1 = hi - 1; | |
if (hi - lo < 3) | |
{ | |
if (hi != lo && cmp(*lo, *hiMinus1) > 0) | |
{ |
This script scans your Dropbox (or any given folder) for folders stored in the ignore
array and excludes them from syncing. Makes use of the official Dropbox CLI
I'm a beginner at bash, so all improvements are welcome!
#!/bin/bash
set -e
# SETTINGS
{ | |
"name": "SyncExtension", | |
"version": "0.1", | |
"manifest_version": 2, | |
"description": "Storage Sync Extension", | |
"permissions": [ "storage" ], | |
"browser_action": { |
These instructions will guide you through the process of setting up local, trusted websites on your own computer.
These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.
NOTE: You may substitute the edit
command for nano
, vim
, or whatever the editor of your choice is. Personally, I forward the edit
command to Sublime Text:
alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
var currentArtboard = [[[doc currentPage] artboards] firstObject]; | |
var layers = selection; | |
var bounds = getBoundsForLayers(layers); | |
for (var i = 0, len = [layers count]; i < len; ++i) { | |
var layer = [layers objectAtIndex:i]; |