Skip to content

Instantly share code, notes, and snippets.

@soyuka
soyuka / Makefile
Created March 3, 2021 11:24 — forked from Pierstoval/confirm.Makefile
"confirm" action for your Makefile
# To use the "confirm" target inside another target,
# use the " if $(MAKE) -s confirm ; " syntax.
mycommand:
@if $(MAKE) -s confirm ; then \
execute_your_command_here ; \
fi
.PHONY: mycommand
# The CI environment variable can be set to a non-empty string,
@soyuka
soyuka / full-disk-encryption-arch-uefi.md
Created March 9, 2020 19:46 — forked from huntrar/full-disk-encryption-arch-uefi.md
Arch Linux Full-Disk Encryption Installation Guide [Encrypted Boot, UEFI, NVMe, Evil Maid]

Arch Linux Full-Disk Encryption Installation Guide

This guide provides instructions for an Arch Linux installation featuring full-disk encryption via LVM on LUKS and an encrypted boot partition (GRUB) for UEFI systems.

Following the main installation are further instructions to harden against Evil Maid attacks via UEFI Secure Boot custom key enrollment and self-signed kernel and bootloader.

Preface

You will find most of this information pulled from the Arch Wiki and other resources linked thereof.

Note: The system was installed on an NVMe SSD, substitute /dev/nvme0nX with /dev/sdX or your device as needed.

Hello,

AbstractObjectNormalizer has a long list of ongoing issues and pull request, we got a talk at Paris Symfony Live with @dunglas @fbourigault and @soyuka on how we want to move forward, here is a resume of our talk and what we would like to achieve for the future:

Current State and Context

At the origin this normalizer was done for API Platform and many other third party libraries / project, in order to have a normalizer that is able to normalize and denormalize any data object (specifically doctrine entities). ObjectNormalizer, PropertyNormalizer and GetSetMethodNormalizer were already existing, but were having slightly different beahvior, that's why two abstract class were created AbstractNormalizer and AbstractObjectNormalizer

Over time, lot of missing features in the ObjectNormalizer were added on both the AbstractObjectNormalizer and the AbstractNormalizer as we needed the same features there.

@soyuka
soyuka / Embedded.php
Created June 5, 2018 17:58 — forked from oxan/Embedded.php
Override API platform embedding decisions
<?php
// src/Serializer/Embedding/Embedded.php
namespace App\Serializer\Embedding;
/**
* @Annotation
* @Target({"PROPERTY", "METHOD"})
*/
class Embedded
@soyuka
soyuka / about.md
Created February 13, 2018 17:10 — forked from mattdesl/about.md
Parse & render SVG with penplot

parse & render SVG file with penplot

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.

test

@soyuka
soyuka / acceleration.sh
Created July 29, 2017 09:46 — forked from tbranyen/acceleration.sh
ThinkPad X1 Carbon 5th Generation libinput acceleration
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
@soyuka
soyuka / README.md
Created February 18, 2016 07:10 — forked from rgrove/README.md
Cake's approach to React Router server rendering w/code splitting and Redux

Can't share the complete code because the app's closed source and still in stealth mode, but here's how I'm using React Router and Redux in a large app with server rendering and code splitting on routes.

Server

  1. Wildcard Express route configures a Redux store for each request and makes an addReducers() callback available to the getComponents() method of each React Router route. Each route is responsible for adding any Redux reducers it needs when it's loaded. (This isn't really necessary on the
var objectToQueryString = function (a) {
var prefix, s, add, name, r20, output;
s = [];
r20 = /%20/g;
add = function (key, value) {
// If value is a function, invoke it and return its value
value = ( typeof value == 'function' ) ? value() : ( value == null ? "" : value );
s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
};
if (a instanceof Array) {
@soyuka
soyuka / stream.js
Last active August 29, 2015 14:08 — forked from Majaxx/stream.js
var db = require('ezseed-database').db
var spawn = require('child_process').spawn
var logger = require('ezseed-logger')('stream')
var fs = require('fs')
var debug = require('debug')('ezseed:stream')
var which = require('which')
var config = require('./config')
//sizes: https://www.ffmpeg.org/ffmpeg-utils.html
const FFMPEG = [

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: