Skip to content

Instantly share code, notes, and snippets.

@PedroHLC
PedroHLC / write-script-derivation.nix
Created October 6, 2023 17:57
A more complex version of writeShellScriptBin that generates a lib directory and make some other stuff easy too
{ lib
, runtimeShell
, stdenvNoCC
}@p:
{ pname
, lib ? p.lib
, runtimeShell ? p.runtimeShell
, stdenv ? stdenvNoCC
, version ? null
, critical ? false
@PedroHLC
PedroHLC / nix-frog-with-capes-web.svg
Created August 25, 2023 14:59
My take in a NixOS logo using FontAwesome's frog with capes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@PedroHLC
PedroHLC / http-errors.pt-br.json
Created June 9, 2023 15:03
ChatGPT, can you generate a JSON file containing user-friendly explanations to the HTTP response status codes in Portuguese (Brazil), but only the error ones?
{
"400": "Requisição inválida. O servidor não pode processar a solicitação devido a um erro do cliente.",
"401": "Não autorizado. O acesso requer autenticação ou as credenciais fornecidas são inválidas.",
"402": "Pagamento necessário. O pagamento é necessário para acessar o recurso solicitado.",
"403": "Proibido. O servidor entende a solicitação, mas se recusa a atendê-la. O acesso é proibido.",
"404": "Não encontrado. O servidor não pôde encontrar o recurso solicitado.",
"405": "Método não permitido. O método de solicitação não é permitido para o recurso solicitado.",
"406": "Não aceitável. O servidor não é capaz de fornecer uma representação adequada para o recurso solicitado.",
"407": "Autenticação de proxy necessária. O cliente deve autenticar-se com o proxy antes de acessar o recurso.",
"408": "Tempo limite de solicitação. O servidor encerrou a conexão devido à solicitação levar muito tempo.",
@PedroHLC
PedroHLC / podman-dnsname.nix
Created March 22, 2023 14:58
Returns dnsname-cni to nixpkgs' podman
{ pkgs, ... }:
{
environment.etc."cni/net.d/87-podman-bridge.conflist".source =
let
cfgExtraPlugins = [{
type = "dnsname";
domainName = "dns.podman";
capabilities.aliases = true;
}];
cfgPackage = pkgs.podman;
diff --git a/pkgs/tools/networking/airgeddon/default.nix b/pkgs/tools/networking/airgeddon/default.nix
index c364d56a5df..07f0f5cad06 100644
--- a/pkgs/tools/networking/airgeddon/default.nix
+++ b/pkgs/tools/networking/airgeddon/default.nix
@@ -1,7 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
-, makeWrapper
+, resholve
@PedroHLC
PedroHLC / hide-paack-generated-file.user.css
Last active March 18, 2022 17:46
GitHub Review | Hide Paack Schemas
/* ==UserStyle==
@name GitHub Review | Hide Paack Schemas
@namespace https://gist.github.com/PedroHLC/d58d608fa9be8f1fe869862e1f617417
@homepageURL https://gist.github.com/PedroHLC/d58d608fa9be8f1fe869862e1f617417
@updateURL https://gist.githubusercontent.com/PedroHLC/d58d608fa9be8f1fe869862e1f617417/raw/hide-paack-generated-file.user.css
@version 0.1.0
@license Other
@description Hide files which are machine-generated from reviews.
@author PedroHLC (https://pedrohlc.com)
==/UserStyle== */
module AlphanumericSorter exposing (AlphanumericSortConfig, alphanumericSort)
type alias AlphanumericSortConfig item =
{ retrieve : item -> String
, smallerFirst : Bool
, emptyOnTail : Bool
, numbersFirst : Bool
}
@PedroHLC
PedroHLC / AnyDict.elm
Created January 20, 2022 13:11
Fork of elm-core's Dict, removing the limitation of the keys' types. (0.19.1)
module AnyDict exposing
( AnyDict, isContentEqual
, empty, singleton, insert, update, remove
, isEmpty, member, get, getMin, findl, findr, size
, keys, values, toList, fromList
, map, foldl, foldr, filter, partition
, union, intersect, diff, merge
)
{-| Fork of [elm-core's Dict](/packages/elm/core/1.0.5/Dict), removing the limitation of the keys' types.
@PedroHLC
PedroHLC / fullwidth-crunchyroll.user.css
Last active August 25, 2021 20:22
Full Width for Crunchyroll
/* ==UserStyle==
@name Full Width for Crunchyroll
@namespace https://gist.github.com/PedroHLC/443557557d1f83bbe4813d7de4b96b29
@homepageURL https://gist.github.com/PedroHLC/443557557d1f83bbe4813d7de4b96b29
@updateURL https://gist.githubusercontent.com/PedroHLC/443557557d1f83bbe4813d7de4b96b29/raw/fullwidth-crunchyroll.user.css
@version 0.1.3
@license Other
@description I like it taking the display's full width...
@author PedroHLC (https://pedrohlc.com)
==/UserStyle== */
--- a/kernel/locking/lockdep_internals.h 2021-04-08 20:34:48.244594696 -0300
+++ b/kernel/locking/lockdep_internals.h 2021-04-08 20:35:08.554843178 -0300
@@ -95,13 +95,13 @@
* conflicts and deadlocks.
*/
#define MAX_LOCKDEP_ENTRIES 16384UL
-#define MAX_LOCKDEP_CHAINS_BITS 15
+#define MAX_LOCKDEP_CHAINS_BITS 17
#define MAX_STACK_TRACE_ENTRIES 262144UL
#define STACK_TRACE_HASH_SIZE 8192