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
(On a math problem, the solutions of which have been independently discovered in | |
essentially every field that encountered it, because nobody seems to come up | |
with a name that others think to search for. This is copy & pasted from an old | |
mail.) | |
It's actually easy to find papers on this because this problem has been chewed on by dozens | |
of researchers over decades, all of them unaware of each other's work (...great). | |
Here's some pointers: |
// C/C++ tips for using printf-style functions | |
// Lots of manipulation can be expressed simply and fast with printf-style formatting | |
// Also helps reducing the number of temporaries, memory allocations or copies | |
// ( If you are looking for a simple C++ string class that is printf-friendly and not heap-abusive, | |
// I've been using this one: https://github.com/ocornut/Str ) | |
// If you are interested in a FASTER implementation of sprintf functions, see stb_sprintf.h | |
// https://github.com/nothings/stb/blob/master/stb_sprintf.h | |
// How to concatenate non-zero terminated strings |
This just got linked to by the Y combinator news account, without proper context, | |
so a brief introduction: A month ago (end of May / early June 2014) I had a | |
Twitter conversation with a bunch of acquaintances. One tweet in the middle | |
of that thread, with obligatory hyperbole, was me saying that I think VR is | |
bad news. | |
Well, that part of the thread (but not the rest that provides context) recently | |
got retweeted, and then someone asked me if I could explain what I mean by that, | |
and because Twitter is a great platform for delivering 140 character slogans and | |
not so great for lengthy explanations, I wrote this. So, obligatory disclaimer: |
# Short of learning how to actually configure OSX, here's a hacky way to use | |
# GNU manpages for programs that are GNU ones, and fallback to OSX manpages otherwise | |
alias man='_() { echo $1; man -M $(brew --prefix)/opt/coreutils/libexec/gnuman $1 1>/dev/null 2>&1; if [ "$?" -eq 0 ]; then man -M $(brew --prefix)/opt/coreutils/libexec/gnuman $1; else man $1; fi }; _' |
static int set_render_state(GDrawRenderState *r, /* ... */) | |
{ | |
static struct gdraw_gl_blendspec { | |
GLboolean enable; | |
GLenum src; | |
GLenum dst; | |
} blends[ASSERT_COUNT(GDRAW_BLEND__count, 6)] = { | |
{ GL_FALSE, GL_ONE, GL_ZERO }, // GDRAW_BLEND_none | |
{ GL_TRUE, GL_ONE, GL_ONE_MINUS_SRC_ALPHA }, // GDRAW_BLEND_alpha | |
{ GL_TRUE, GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA }, // GDRAW_BLEND_multiply |
Option 1: WHAT WE HAVE TODAY | |
glEnable(GL_DEPTH_TEST); | |
glDepthFunc(GL_LEQUAL); | |
// Blah | |
glDisable(GL_DEPTH_TEST); | |
Option 2: ONE ENTRY POINT, EXTRA PARAMETER |
#EXTM3U | |
#EXTINF:-1,BBC - Radio 1 | |
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p | |
#EXTINF:-1,BBC - Radio 2 | |
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio2_mf_p | |
#EXTINF:-1,BBC - Radio 3 | |
http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/http-icy-aac-lc-a/format/pls/vpid/bbc_radio_three.pls | |
#EXTINF:-1,BBC - Radio 4 | |
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_p | |
#EXTINF:-1,BBC - Radio 5 live |
I want to be extremely clear about three things. First, this is my personal opinion – insert full standard disclaimer. Second, this is not a condemnation of everyone at RSA, present and past. I assume most of them are pretty okay, and that the problem is confined to a few specific points in the company. However, “unknown problem people making major decisions at RSA” is a bit unwieldy, so I will just say RSA. Third, I'm not calling for a total boycott on RSA. I work almost literally across the street from them and I don’t want to get beat up by roving gangs of cryptographers at the local Chipotle.
RSA's denial published last night is utter codswallop that denies pretty much everything in the world except the actual allegations put forth by Reuters and hinted at for months by [other sources](http://li