Chromium OS is cool. Chromium OS with crouton is cooler. Chromium OS with Docker is even cooler. This is specifically a guide for the Chromebook Pixel 2 (2015), but I can't think of any reason it wouldn't work with other devices.
{ | |
"definitions": { | |
"thing": { | |
"$ref": "#/definitions/thing" // circular reference to self | |
}, | |
"person": { | |
"properties": { | |
"name": { | |
"type": "string" | |
}, |
^([0-9]+)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(([Zz])|([\+|\-]([01][0-9]|2[0-3]):[0-5][0-9]))$ |
<?php | |
class ConfigController { | |
const MODEL = 'App\Models\Config'; | |
// see RestControllerTrait. sends less data on indexing the list of the model | |
// protected $indexFields = [ 'name' ]; | |
protected $triggers = [ | |
// 'show' => 'extendObject', | |
// 'update' => 'dataFormatFix', |
<?php | |
/** | |
* Acquires a lock using flock, provide it a file stream, the | |
* lock type, a timeout in microseconds, and a sleep_by in microseconds. | |
* PHP's flock does not currently have a timeout or queuing mechanism. | |
* So we have to hack a optimistic method of continuously sleeping | |
* and retrying to acquire the lock until we reach a timeout. | |
* Doing this in microseconds is a good idea, as seconds are too | |
* granular and can allow a new thread to cheat the queue. |
PDO::FETCH_FUNC without validation | |
10: 0.001568078994751 | |
0.00071001052856445 | |
0.00085306167602539 | |
0.00087618827819824 | |
0.00083112716674805 | |
100: 0.0012631416320801 | |
0.0014598369598389 |
https://coreosfest2017.sched.com/event/AWYc/best-practices-for-go-grpc-services-doug-fawley-google
Just small note for me. Hope the slide will be opened.
- API design
- Idmpotency
- It should be safe to retry an RPC without knowing whether it was processed
- Idmpotency
- Example
let cache = new Map(); | |
let pending = new Map(); | |
function fetchTextSync(url) { | |
if (cache.has(url)) { | |
return cache.get(url); | |
} | |
if (pending.has(url)) { | |
throw pending.get(url); | |
} |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const jsdom = require('jsdom'); | |
/** @typedef {import("webpack/lib/Compiler.js")} WebpackCompiler */ | |
/** @typedef {import("webpack/lib/Compilation.js")} WebpackCompilation */ | |
/** @typedef {(import 'jsdom').ResourceLoaderConstructorOptions} ResourceLoaderConstructorOptions */ | |
class PrerenderHtmlPlugin { | |
constructor(options) { | |
this._options = options || { }; |
Every once in a blue moon, I like to hack up some crazy toy proof of concept to get away from everyday's stiff serious production-ready coding. This morning, I decided to mess around with an idea of implementing something similar to Svelte's reactive variables, but using pure Javascript.
So here's that godawful eye-bleeding fun hack: a 7-line "svelte" (needless to say, it doesn't do nearly enough to be useful in the real world and breaks just about every best practice rule in the book because why the hell not)
https://codepen.io/lhorie/pen/BaRzgRe
Can you figure out why this works? Any ideas to make it more devilish/clever/insane are welcome :)