Chromium OS is cool. Chromium OS with crouton is cooler. Chromium OS with Docker is even cooler. This is specifically a guide for the HP Chromebook 13 G1 (aka HP Spyder Chromebook), but I can't think of any reason it wouldn't work with other devices. The Chromebook Pixel 2 (2015), for example...as you'll notice, the guide this was forked from assumed that machine.
<?php | |
function gen($arg1) { | |
var_dump($b = yield $arg1 + 1); | |
var_dump($d = yield $b + 2); | |
$ret = $d + 2; | |
var_dump($ret); | |
return $ret; | |
} |
<?php | |
if ($argc < 3) { | |
error_log("Usage: php gitlab_archive.php <private_token> <namespaced path> <optional-branch-or-commit-sha> > archive.tar.gz"); die(); | |
} | |
$token = $argv[1]; | |
$path = $argv[2]; | |
$ref = isset($argv[3]) ? $argv[3] : null; |
FROM alpine:3.3 | |
# install packages | |
RUN echo "@testing http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \ | |
apk add --update php7-common@testing php7-pdo_mysql@testing \ | |
php7-pcntl@testing php7-json@testing php7-opcache@testing \ | |
php7-mbstring@testing php7-fpm@testing php7@testing nginx runit@testing | |
# set up app | |
RUN mkdir /var/app |
To install this, create a bookmark and copy and paste the above verbatim into there. To use it, first go to the conversation you want to single out in messenger.com, then navigate to the bookmarklet you created. The lefthand conversation list pane will vanish, and you'll be left with the IMs for your conversation in a window that has no minimum width (normally the conversation pane has a minimum width).
As fair warning, if Facebook updates the Messenger app then this hack may (probably will) stop working. This code is provided as-is and with no warranty whatsoever.
mDNS shows local machines
There are two network-related components of this utility: announce and pull. When you want to share a repo or branch with another user, you'll send an announcement to their host. That announcement will contain enough information to fetch the branch/repo from your system. When the targeted user receives the announcement, they can either ignore it or accept it. In the latter case, they may fetch the repo into its own new repo/branch or merge it with an existing local repo/branch via a temporary remote that lasts until they've finished pulling. If they want to share changes back with you, they announce the availability of a branch with the specified changes and you can accept/pull from them. Pushing from point to point (not counting the announcement) is not supported.
To allow for finer-grained ACLs, the announced remote is exposed via HTTP on a >1024 port with a set of credentials specific to a given announcement (which can contain exactly one repo or branch). The web server at this
<?php | |
/** | |
* PHP's curl extension won't let you pass in strings as multipart file upload bodies; you | |
* have to direct it at an existing file (either with deprecated @ syntax or the CURLFile | |
* type). You can use php://temp to get around this for one file, but if you want to upload | |
* multiple files then you've got a bit more work. | |
* | |
* This function manually constructs the multipart request body from strings and injects it | |
* into the supplied curl handle, with no need to touch the file system. |
<?php | |
namespace BaseNamespace\Service; | |
// this should be an interface but I'm lazy | |
class EmailService | |
{ | |
/* properties */ | |
public function __construct(/* params */) { |
<?php | |
class FastForwarder | |
{ | |
protected $skipWhen = []; | |
protected $numDays = 0; | |
public static function createWithDays($num_days) | |
{ | |
$ff = new static; |
(function() { // force re-render of element_name to get the styling right on-print | |
var beforePrint = function() { | |
var el = document.getElementById('element_name'); // e.g. an input inside a <p>... | |
var p = el.parentNode; // ...which will normally fail to style entirely on-print... | |
p.removeChild(el); // ...but if you wrap it in a <span> or the like, then remove and re-add the element... | |
p.appendChild(el); // ...the styles will recalculate and you'll get whatever style you were trying to apply! | |
}; | |
if (window.matchMedia) { | |
window.matchMedia('print').addListener(function(mql) { |