Skip to content

Instantly share code, notes, and snippets.

@quentint
quentint / har-extract.js
Last active December 12, 2017 11:21 — forked from amishshah/har-extract.js
Rough script to extract files from HTTP Archive (HAR) files
const fs = require('fs');
const file = JSON.parse(fs.readFileSync('./my-file.har')).log;
const targetMimeType = 'application/font-woff';
let count = 0;
for (const entry of file.entries) {
if (entry.response.content.mimeType === targetMimeType) {
let fileName = entry.request.url.split('/').pop();
// Ensure output directory exists before running!
fs.writeFileSync(`./output/${fileName}`, new Buffer(entry.response.content.text, 'base64'), 'binary');
@quentint
quentint / Kernel.php
Last active May 5, 2021 14:47 — forked from carteni/AppBundle.php
[Twig] Refreshing modified Templates when OPcache or APC is enabled.
<?php
/**
* @file src/Kernel.php
*/
<?php
namespace App;
@quentint
quentint / windows-wsl2-docker-lando-php-xdebug.md
Created October 17, 2022 09:02 — forked from rockschtar/windows-wsl2-docker-lando-php-xdebug.md
Windows 10/11 + WSL2 + Docker + Lando + PHP XDebug (PHPStorm, IntelliJ & Visual Studio Code (vscode))
  1. Install WSL
  2. Install your preferred WSL Linux Distro vom Microsoft Store. In my case I used Ubuntu 20.04.
  3. Install Docker for Windows
  4. Enable Docker WSL2 Integration image
  5. Install Lando inside WSL
wget https://github.com/lando/lando/releases/download/v3.6.0/lando-x64-v3.6.0.deb
dpkg -i --ignore-depends=docker-ce lando-x64-v3.6.0.deb