const groupBy = key => array =>
array.reduce((objectsByKeyValue, obj) => {
const value = obj[key];
objectsByKeyValue[value] = (objectsByKeyValue[value] || []).concat(obj);
return objectsByKeyValue;
I just got this working so I figured I'd share what I found, since there's hardly any information about this anywhere online except an RFC, the GPG mailing list and one tutorial from the GnuPG blog.
You can use automatic key discovery with WKD (Web key directory) to make it easy for users to import your key, in GPG since version 2.1.12. Since this feature is fairly new, it isn't yet available in the current LTS release of Ubuntu (16.04; xenial), however it is available in Debian stable (stretch).
I couldn't add a DNS CERT or DANE / OPENPGPKEY record through my email service (which also hosts my nameservers). I tried making the PKA record - a foo._pka.example.com
TXT record but GPG doesn't seem to recognize it and fails; I'm still investigating why.
So the last option for self-hosted auto-discovery was WKD.
First thing I had to do was add an email address to my key. My primary UID is just my name so the key represents my identity rather
# Laravel queue worker using systemd | |
# ---------------------------------- | |
# | |
# /lib/systemd/system/queue.service | |
# | |
# run this command to enable service: | |
# systemctl enable queue.service | |
[Unit] | |
Description=Laravel queue worker |
public function connections()
{
$relation = $this
->belongsToMany(static::class, 'connections', 'requestor_id', 'requested_id')
->withTimestamps();
/// delete the already built inner join
$relation
->getQuery() // Eloquent\Builder
/** | |
* Sadly neither Chrome or Firefox fully support the functionality herein. | |
* Chrome supports only registerProtocolHandler, and Firefox supports | |
* a limited set of content handlers - at the moment it's pretty much | |
* just RSS feeds. These do work great in the older Opera 12 though. | |
* | |
* I've moved on from the abandoned Opera to Firefox but I put these | |
* here for future reference, hopefully browsers implement both | |
* navigator.registerProtocolHandler and navigator.registerContentHandler | |
* fully in the near future. |
I looked at a lot of solutions for this and here's what I've come up with:
(function getjQuery(callback) {
if ('complete' === document.readyState) {
var script = document.createElement('script');
var target = document.documentElement;
script.src = '//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js';
Create and enter a working directory
mkdir -p ~/dnscrypt-working-directory && cd ~/dnscrypt-working-directory
Become root
sudo -s
<?php | |
# http://jeffreysambells.com/2012/10/25/human-readable-filesize-php | |
function human_filesize($bytes, $decimals = 2) { | |
$size = array('B','kB','MB','GB','TB','PB','EB','ZB','YB'); | |
$factor = floor((strlen($bytes) - 1) / 3); | |
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$size[$factor]; | |
} | |
echo human_filesize(filesize('example.zip')); |
// ActiveTable - a bookmarklet to make tables sortable and editable | |
function init() { | |
var aHrows = getHrows(); | |
var numHrows = aHrows.length; | |
var aHidden = getHiddenColumns(); | |
ATpopup = document.createElement("div"); | |
ATpopup.style.cssText = "position: absolute; visibility: hidden; padding: 0; font-family: Arial; background-color: rgba(255, 255, 255, 0.9); border-radius: .5em; text-align: center; box-shadow: .05em .05em .5em #00C;"; | |
ATpopup.innerHTML = "<a href='sort' title='sort' onclick='sortColumn(); return false'><img border=0 src='http://stevesouders.com/images/sort_up_down.png' style='padding-top: 0.2em;'></a><br><a href='hide' style='color: #C00; font-family: monospace; font-size: 1.5em; text-decoration: none;' title='hide' onclick='hideColumn(); return false'>x</a>"; // TODO - use protocol-less URL for img |