Skip to content

Instantly share code, notes, and snippets.

@nkaretnikov
nkaretnikov / README.md
Created September 27, 2019 15:08
lldb trace

Start debugserver:

tty0 # debugserver localhost:8000 main

Start tracing:

tty1 $ lldb
tty1 (lldb) command script import trace.py
tcp:
routers:
rou_dot:
entryPoints:
- dot
rule: HostSNI(`my.dot.domain.here`)
service: svc_dot
tls:
certResolver: le
services:
@quentint
quentint / wsl2-lando-phpstorm.md
Last active May 1, 2024 17:38
WSL2 / Lando / PhpStorm

This guide aims to be the reference for setting up Lando and PhpStorm tools on a WSL2 environment.

This assumes your project:

  • lives in a WSL2 instance (something like \\wsl$\Ubuntu\home\[user]\dev\my-demo-project)
  • Is "Lando-initialized" (lando init) and runs (lando start)
  • uses Composer, and dependencies are installed (lando composer install)

Docker

This guides relies on Docker for Windows, using the WSL2 based engine, and setup with WSL integration (Resources > WSL Integration). Unfortunately I didn't find a solution to do without it and only rely on WSL's Docker.

@clamydo
clamydo / configuration.nix
Created April 4, 2024 09:17
Minimal example how to pass a sops-nix secret into a systemd-nspawn container via systemd's credential system.
{ config, lib, pkgs, ... }:
{
imports = [
${builtins.fetchTarball
"https://github.com/Mic92/sops-nix/archive/master.tar.gz"
}/modules/sops"
];
users = {
@Widdershin
Widdershin / ssr.md
Last active May 1, 2024 17:36
The absurd complexity of server-side rendering

In the olden days, HTML was prepared by the server, and JavaScript was little more than a garnish, considered by some to have a soapy taste.

After a fashion, it was decided that sometimes our HTML is best rendered by JavaScript, running in a user's browser. While some would decry this new-found intimacy, the age of interactivity had begun.

But all was not right in the world. Somewhere along the way, we had slipped. Our pages went uncrawled by Bing, time to first meaningful paint grew faster than npm, and it became clear: something must be done.

And so it was decided that the applications first forged for the browser would also run on the server. We would render our HTML using the same logic on the server and the browser, and reap the advantages of both worlds. In a confusing series of events a name for this approach was agreed upon: Server-side rendering. What could go wrong?

In dark rooms, in hushed tones, we speak of colours.

@ckabalan
ckabalan / best_bash_history.sh
Last active May 1, 2024 17:29
The Best Bash History Settings Ever
# /etc/profile.d/best_bash_history.sh
# Save 5,000 lines of history in memory
HISTSIZE=10000
# Save 2,000,000 lines of history to disk (will have to grep ~/.bash_history for full listing)
HISTFILESIZE=2000000
# Append to history instead of overwrite
shopt -s histappend
# Ignore redundant or space commands
HISTCONTROL=ignoreboth
# Ignore more
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active May 1, 2024 17:28
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@hhkaos
hhkaos / script.md
Last active May 1, 2024 17:28
From Zero to Newbie with ArcGIS API for JS and TypeScript

From zero to newbie with ArcGIS API for JS and TS.

Hello TypeScript demo

Initialize a typescript project:

npm init -y
npm i typescript --save-dev
@CreatureSurvive
CreatureSurvive / HeaderAttribute.cs
Last active May 1, 2024 17:26
Better inspector headers in Unity
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
#endif
//using CS;
//[System.Serializable]
//public class HeaderExampleClass
//{
// [Header("My Fields", 3)]
@fhferreira
fhferreira / RetryAllFailedJobsCommand.php
Created December 8, 2023 04:01 — forked from ulcuber/RetryAllFailedJobsCommand.php
Laravel Horizon. Retry all of the failed jobs like one in the horizon dashboard
<?php
namespace App\Console\Commands\Horizon;
use Illuminate\Console\Command;
use Illuminate\Queue\Failed\FailedJobProviderInterface;
use Laravel\Horizon\Contracts\JobRepository;
use Laravel\Horizon\Jobs\RetryFailedJob;
class RetryAllFailedJobsCommand extends Command