Skip to content

Instantly share code, notes, and snippets.

View gemmadlou's full-sized avatar

Gemma Black gemmadlou

View GitHub Profile
@eusonlito
eusonlito / 01-README.md
Last active April 2, 2025 16:51
SQLite optimization for Laravel

The SQLite optimizations must be carried out at two different times: once in a unique and permanent way for the database and another time for each connection that is made. Below are the configurations that should be made in each case.

Unique and Permanent Configurations

These configurations are set only once and affect the database persistently, meaning they do not need to be reconfigured each time a connection is established:

PRAGMA journal_mode = WAL;

Sets the database journal mode to "WAL" (Write-Ahead Logging), which improves performance in concurrent operations.

@james2doyle
james2doyle / 0000_01_01_000000_set_sqlite_extensions.php
Last active October 7, 2024 13:54
Use a Laravel migration to set some PRAGMA performance settings in Sqlite
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
return new class extends Migration
{
/**
* Run the migrations.
*/
// > file-sync-blocking.test.mjs
import test from 'node:test';
import assert from 'node:assert';
import fs from "node:fs";
test('reading file 10,000 times with callback blocking', (t) => {
for (let i = 0; i < 10000; i++ ) {
const data = fs.readFileSync("./text.txt", { encoding: 'utf-8'})
assert.strictEqual(data, "Hello, world")
}
@alonlavian
alonlavian / vpc-inside.py
Created August 7, 2022 08:09
Describe resources inside an AWS VPC
import logging
import boto3
from argparse import ArgumentParser, HelpFormatter
from botocore.exceptions import ClientError, ProfileNotFound
# logger config
logger = logging.getLogger()
logging.basicConfig(level=logging.INFO,
format='%(message)s')

What Hiring Should Look Like

This is definitely not the first time I've written about this topic, but I haven't written formally about it in quite awhile. So I want to revisit why I think technical-position interviewing is so poorly designed, and lay out what I think would be a better process.

I'm just one guy, with a bunch of strong opinions and a bunch of flaws. So take these suggestions with a grain of salt. I'm sure there's a lot of talented, passionate folks with other thoughts, and some are probably a lot more interesting and useful than my own.

But at the same time, I hope you'll set aside the assumptions and status quo of how interviewing is always done. Just because you were hired a certain way, and even if you liked it, doesn't mean that it's a good interview process to repeat.

If you're happy with the way technical interviewing currently works at your company, fine. Just stop, don't read any further. I'm not going to spend any effort trying to convince you otherwise.

@jesugmz
jesugmz / solve-load-pubkey-id_rsa-invalid-format.md
Last active December 2, 2022 23:35
Solve load pubkey "/root/.ssh/id_rsa": invalid format

OpenSSH 8.3p1 introduces the need of having a public SSH key otherwise is gonna show the warning

load pubkey "/root/.ssh/id_rsa": invalid format

# ssh -V
OpenSSH_8.3p1, OpenSSL 1.1.1g  21 Apr 2020

To supress this message we can put in place our SSH public key or generate it from our private key with:

@eusonlito
eusonlito / README.md
Last active June 28, 2024 17:37
Laravel Auth and Session without database. Using a remote API as Auth and Data provider.

This is an example of a web that uses a remote API as a database wrapper.

The remote API is stateless and the web uses cookies to maintain session persistence.

The API authentication endpoint returns a TOKEN that allows the web to make each request to the API with the user authentication header.


Este es un ejemplo de web que usa una API remota como wrapper de base de datos.

@laravel-shift
laravel-shift / .php-cs-fixer.php
Last active March 29, 2025 12:18
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',
@mkhmylife
mkhmylife / laravel-k8s-configmap.yaml
Created May 3, 2019 18:31
Laravel Kubernetes Deployment files
apiVersion: v1
kind: ConfigMap
metadata:
name: backend-config
data:
APP_DEBUG: "false"
APP_ENV: production
APP_KEY: changeme
APP_LOG_LEVEL: debug
APP_NAME: "Laravel K8s"
@sshymko
sshymko / install_mysql_client.sh
Last active December 17, 2024 21:17
Install MySQL 5.7 client on Amazon Linux 2
#!/bin/sh
sudo yum install -y https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
sudo yum install -y mysql-community-client