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
// This will only work in environments that support ES6 Proxies. | |
// As of right now, that's pretty much only Firefox. | |
function Refrigerator(foods) { | |
this.foods = foods; | |
return new Proxy(this, { | |
get: function (receiver, name) { | |
if (name in receiver) { |
# This is an example of the Stack Exchange Tier 1 HAProxy config | |
# The only things that have been changed from what we are running are: | |
# 1. User names have been removed | |
# 2. All Passwords have been remove | |
# 3. IPs have been changed to use the example/documentation ranges | |
# 4. Rate limit numbers have been changed to randome numbers, don't read into them | |
userlist stats-auth | |
group admin users $admin_user | |
user $admin_user insecure-password $some_password |
# Exporting entire database: | |
mysqldump -u user -p database --opt | gzip > database.sql.gz | |
# Export table | |
mysqldump -uroot --opt --databases DB_NAME --tables TABLE_NAME | gzip > /tmp/TABLE_NAME.export.sql.gz | |
# Importing: | |
gunzip < database.sql.gz | mysql -u user -p database | |
# Credit http://failshell.io/mysql/using-gzip-and-gunzip-with-mysql-to-importexport-backups/ |
This document contains some notes I have gathered while I was trying to setup a redis service using boot2docker running on OS X. This won't cover what Docker is, see Docker website for details.
First, install Virtualbox and follow the steps at http://docs.docker.com/installation/mac/
Since Docker only runs on Linux, boot2docker runs a virtual machine in Virtualbox (or VMWare etc), however you can run the docker command on OS X
core@coreos-local ~ $ ./nspawn-container jmatis/tomcat7 "/opt/start-watch-tomcat.sh" | |
Pulling repository jmatis/tomcat7 | |
b3dfa5e5f738: Download complete | |
511136ea3c5a: Download complete | |
5e66087f3ffe: Download complete | |
4d26dd3ebc1c: Download complete | |
d4010efcfd86: Download complete | |
99ec81b80c55: Download complete | |
c17d434dd941: Download complete | |
180579a76826: Download complete |
Ruby 2.1.0 in Production: known bugs and patches | |
Last week, we upgraded the github.com rails app to ruby 2.1.0 in production. | |
While testing the new build for rollout, we ran into a number of bugs. Most of | |
these have been fixed on trunk already, but I've documented them below to help | |
anyone else who might be testing ruby 2.1 in production. | |
@naruse I think we should backport these patches to the ruby_2_1 branch and | |
release 2.1.1 sooner rather than later, as some of the bugs are quite critical. | |
I'm happy to offer any assistance I can to expedite this process. |
#The power of z
Do you spend lots of time doing things like this?
cd this/is/the/path/that/i/want/so/i/type/it/all/out/to/get/whereiwant
With z, you could just do this:
# LBs have 8 cores. One is used for haproxy, rest are used for nginx workers | |
worker_processes 7; | |
worker_rlimit_nofile 90000; | |
pid <PID_FILE>; | |
events { | |
use epoll; | |
multi_accept off; | |
accept_mutex off; |
# put this piece of code in your spec/spec_helper.rb or spec/support/any_rb_file.rb | |
# then run `rake spec` | |
module CleanerBench | |
def clean(*) | |
now = Time.now | |
super | |
@time_spent ||= 0 | |
@time_spent += Time.now - now | |
end |