Skip to content

Instantly share code, notes, and snippets.

View borjapazr's full-sized avatar
🐮
Éche o que hai!

Borja Paz Rodríguez borjapazr

🐮
Éche o que hai!
View GitHub Profile
@kconner
kconner / macOS Internals.md
Last active November 13, 2024 07:51
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@sussycatgirl
sussycatgirl / Caddyfile
Last active November 5, 2024 12:27
Authentik Forward Auth with Caddy
# Put this somewhere near the top of your Caddyfile (at the root, not in a site directive).
# Replace `http://127.0.0.1:9000` with your *internal* Authentik outpost's hostname and port
(authentik_forwardauth) {
reverse_proxy /outpost.goauthentik.io/* http://127.0.0.1:9000
forward_auth {args.0} http://127.0.0.1:9000 {
uri /outpost.goauthentik.io/auth/caddy
copy_headers X-Authentik-Username X-Authentik-Groups X-Authentik-Email X-Authentik-Name X-Authentik-Uid X-Authentik-Jwt X-Authentik-Meta-Jwks X-Authentik-Meta-Outpost X-Authentik-Meta-Provider X-Authentik-Meta-App X-Authentik-Meta-Version
trusted_proxies private_ranges
}
}
@AlbertoBasalo
AlbertoBasalo / eslint.json
Last active September 22, 2022 12:38
ESLint configuration for clean TypeScript
{
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["prettier", "@typescript-eslint"],
"env": {
@acarril
acarril / global-protect.md
Last active November 3, 2024 00:49
GlobalProtect toggle (start/quit)

Regain control over the annoying GlobalProtect macOS install

I need to use GlobalProtect because it's becoming the only VPN to access resources in my school. The VPN client is simple enough, but it does two annoying things:

  1. Registers itself to autostart on login
  2. Doesn't provide you with a simple 'quit' action

Here I'll show you how I fixed both issues in macOS 12.2 (Monterey).

image

@sts10
sts10 / rust-command-line-utilities.markdown
Last active November 14, 2024 19:54
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@eneajaho
eneajaho / server-client-side-only.directive.ts
Created November 25, 2021 13:32
Server/Client side only - Angular Directive
import { Directive, Inject, NgModule, OnInit, PLATFORM_ID, TemplateRef, ViewContainerRef } from '@angular/core';
import { isPlatformBrowser, isPlatformServer } from '@angular/common';
/**
* Add the template content to the DOM based on platform
*/
@Directive({ selector: '[serverSideOnly]' })
export class ServerSideOnlyDirective implements OnInit {
@florestankorp
florestankorp / .eslintrc.js
Created April 19, 2021 13:52
ES Lint Rules
module.exports = {
ignorePatterns: ['.eslintrc.js'],
env: {
browser: true,
es6: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
@LeZuse
LeZuse / 00_README.md
Last active November 1, 2024 02:35
Install node on Apple Silicon M1 both ARM and x86 (Rosetta)

Node.js on Apple Silicon

Node Version Manager (https://github.com/nvm-sh/nvm) works perfectly across native node installations as well as emulated Rosetta installations. The trick I am using here is to install one LTS version of node under Rosetta and another stable version as native binary.

TODO

  • find a way how to run the same node version on both platforms
@m-radzikowski
m-radzikowski / script-template.sh
Last active November 15, 2024 11:25
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]