Interpolating between things using lerp
.
function lerp (start, end, t) {
return start * (1 - t) + end * t;
}
Roots for record 0 (stored at leaf 0): [ 0 ] | |
0: 0 | |
Roots for record 1 (stored at leaf 2): [ 1 ] | |
0: 0─┐ | |
1 | |
1: 2─┘ | |
Roots for record 2 (stored at leaf 4): [ 1, 4 ] | |
0: 0─┐ |
<?php | |
// src/Serializer/Embedding/Embedded.php | |
namespace App\Serializer\Embedding; | |
/** | |
* @Annotation | |
* @Target({"PROPERTY", "METHOD"}) | |
*/ | |
class Embedded |
So, as I mentioned last time, I have two fundamental goals with dat that are not addressed by simply running dat share
.
To break these down a bit more, uptime is a combination of two things:
<?php | |
$query = <<<'GRAPHQL' | |
query GetUser($user: String!) { | |
user (login: $user) { | |
name | |
repositoriesContributedTo { | |
totalCount | |
} |
addEventListener('fetch', event => { | |
event.respondWith(fetchAndCheckPassword(event.request)) | |
}) | |
async function fetchAndCheckPassword(req) { | |
if (req.method == "POST") { | |
try { | |
const post = await req.formData(); | |
const pwd = post.get('password') | |
const enc = new TextEncoder("utf-8").encode(pwd) |
This might be handy if you have an SVG file that you want to use as, say, a mask for a generative algorithm.
Place the SVG file in the same directory that you are running penplot from.
Synology NAS - How to make a program run at startup | |
The other day I created a little node.js project to keep track of some finances. Synology has a node.js package but that just installs the tools - it has no 'container' or any other support to drop files and have it run automagically. Maybe one day. | |
In the meantime, you can start your project when you SSH into the NAS. My project has a 'www' script which bootstraps my project, so to start I simply type 'node bin/www' from the project directory. But, it only runs while I'm logged in, and if I log out for any reason, the process dies. That's hardly useful when I'm away from home, or on a different PC. So I decided to have a look at starting my project as a Linux service. | |
After doing a lot of research into how Synology does services, and a few failed attempts at init scripts, I found that Synology DSM (since version 5 perhaps) bundles Upstart, which is a neat little tool to deal with services on Linux. It's most prevalent on Debian and derivatives (notably Ub |
In patch 8.0.1206, Vim has added 2 new events: CmdlineEnter
and CmdlineLeave
. They are fired every time you enter or leave a command line.
There are 7 types of command lines, including one for normal Ex commands, debug mode commands, search commands
(with a distinction between forward and backward), expressions, and inputs (more info at :h cmdwin-char
).
Each of them is associated with a symbol among this set : > / ? = @ -
.
You can limit the effect of an autocmd listening to CmdlineEnter
/ CmdlineLeave
to one or several types of command lines by:
touchpad_id=$(xinput --list | grep "TouchPad" | xargs -n 1 | grep "id=" | sed 's/id=//g') | |
accel_speed_code=$(xinput --list-props $touchpad_id | awk '/Accel Speed \(/ {print $4}' | grep -o '[0-9]\+') | |
# Default acceleration is too slow (non-existent) | |
xinput --set-prop $touchpad_id $accel_speed_code .75 |