(ab)using CSS3’s :nth-child() selector to invent new ones

When combining :nth-child() with some other pseudo selectors, one can actually create new types of selectors. “:nth-of-m-child” selector /** * This selector will select the third element in a row, * if it is also the third to last element … thus selecting * the 3rd child in a row of 5 elements */ span:nth-child(3):nth-last-child(3) …

Moon Phase and Libration, 2015

This visualization shows the Moon’s phase and libration at hourly intervals throughout 2015, as viewed from the northern hemisphere. Each frame represents one hour. In addition, this visualization shows the Moon’s orbit position, sub-Earth and subsolar points, distance from the Earth at true scale, and labels of craters near the terminator. Scientific Visualisation Studio: Moon …

Moonpig vulnerability

Decoding the auth header we get *redacted*:*redacted*, that’s not my username or password – these are static credentials sent with every request. The only identifiable piece of information left is the URL parameter customerId. […] Every API request is like this, there’s no authentication at all and you can pass in any customer ID to …

ANSI Control Functions and ANSI Control Sequences (Colors, Erasing, etc.) for PHP CLI Apps

As a side project for Monolog Colored Line Formatter (which int itself also is a side project for Mixed Content Scan) I just published is ANSI PHP. bramus/ansi-php is a set of classes to working with ANSI Control Functions and ANSI Control Sequences (ANSI Escape Sequences) on text based terminals. ANSI Control Functions control an …

Monolog Colored Line Formatter

Over a year ago I quickly whipped up a Colored Line Formatter for use with Monolog. As I’m building colorised output into Mixed Content Scan I – finally – took the time to actually put the darn thing out in the open. bramus/monolog-colored-line-formatter is a formatter for use with Monolog. It augments the Monolog LineFormatter …

Bunyan

$ cat hi.js var bunyan = require(‘bunyan’); var log = bunyan.createLogger({name: ‘myapp’}); log.info(‘hi’); log.warn({lang: ‘fr’}, ‘au revoir’); $ node hi.js {“name”:”myapp”,”hostname”:”banana.local”,”pid”:40161,”level”:30,”msg”:”hi”,”time”:”2013-01-04T18:46:23.851Z”,”v”:0} {“name”:”myapp”,”hostname”:”banana.local”,”pid”:40161,”level”:40,”lang”:”fr”,”msg”:”au revoir”,”time”:”2013-01-04T18:46:23.853Z”,”v”:0} Bunyan is a simple and fast JSON logging library for node.js services The true power comes when it’s combined with the bundled bunyan binary, which pretty-prints bunyan logs: Like so: $ node …

PHPCI – Continuous Integration for PHP Projects

PHPCI is a free and open source continuous integration tool specifically designed for PHP. Built with simplicity in mind and featuring integrations with all of your favourite testing tools, we’ve created the very best platform for testing your PHP projects. Looks interesting. Host it yourself, or make use of one of the hosted plans. PHPCI …

Cordova build hook script for displaying build version in your app

#!/usr/bin/env node // This plugin replaces text in a file with the app version from config.xml. var wwwFileToReplace = "js/build.js"; var fs = require('fs'); var path = require('path'); var rootdir = process.argv[2]; function loadConfigXMLDoc(filePath) { var fs = require('fs'); var xml2js = require('xml2js'); var json = ""; try { var fileData = fs.readFileSync(filePath, 'ascii'); var …

Why aren’t we using SSH for everything?

ssh http://t.co/E7Ilc0B0BC pic.twitter.com/CqYBR1WYO4 — Andrey Petrov (@shazow) December 13, 2014 If we can write a chatroom on top of SSH, why don’t we use it for more things? Interesting read packed with dozens of facts about the SSH protocol and why we should use it for more things. Why aren’t we using SSH for everything? …