Skip to content

Instantly share code, notes, and snippets.

View almino's full-sized avatar

Almino almino

View GitHub Profile
@almino
almino / nfs-home.nix
Last active November 29, 2023 01:30
Servarr configuration example for NixOS
{ lib, ... }:
{
fileSystems."/export/1tb" = {
device = "/dev/disk/by-uuid/64de61f9-c996-4c22-a045-066782140a1c";
label = "HD do antigo notebook";
noCheck = true;
options = lib.mkDefault [
"defaults"
"x-gvfs-show"
@almino
almino / gnome-dconf.nix
Created October 6, 2023 17:55
GNOME dconf in a fresh NixOS installation
# Generated via dconf2nix: https://github.com/gvolpe/dconf2nix
{ lib, ... }:
with lib.hm.gvariant;
{
dconf.settings = {
"org/gnome/desktop/app-folders" = {
folder-children = [ "Utilities" "YaST" ];
};
@almino
almino / settings.json
Created September 21, 2023 16:17
VS Code before Nix
{
"yaml.schemas": {
"file:///home/almino/.vscode/extensions/atlassian.atlascode-2.10.12/resources/schemas/pipelines-schema.json": "bitbucket-pipelines.yml"
},
"atlascode.jira.enabled": false,
"redhat.telemetry.enabled": true,
"terminal.external.linuxExec": "/usr/bin/fish",
"terminal.integrated.defaultProfile.linux": "fish",
"git.suggestSmartCommit": false,
"workbench.iconTheme": "vscode-icons",
@almino
almino / README.md
Created August 5, 2023 21:01
Start Minecraft Fabric server when Ubuntu starts

Copy minecraft.service to /etc/systemd/system/ start.sh goes in your Minecraft server folder.

@almino
almino / README.md
Last active August 7, 2023 13:14
Ubuntu 22.04 novo

Configurar tecla de atalho para o explorador de arquivos

nautilus recent:///

Alt + Tab para todas as instâncias de aplicativos

https://superuser.com/a/1733383/172232

gsettings set org.gnome.shell.window-switcher current-workspace-only false
gsettings set org.gnome.shell.app-switcher current-workspace-only false
@almino
almino / Dockerfile
Created July 21, 2020 23:30
PHP Composer on a Docker container
FROM composer
RUN chown -Rf 1000:33 /tmp \
&& composer global require hirak/prestissimo
@almino
almino / regex.md
Created October 19, 2019 01:14
Preparar arquivos de configuração do Laravel para usar variáveis de ambiente

Substituir configurações que NÃO tem valor padrão

env\(('\w+')\)
env($1, $_ENV[$1])

Substituir configurações que TEM valor padrão

env\(('\w+'), (['\w\.@]+)\)
env($1, $_ENV[$1] ?? $2)
@almino
almino / human-name-shortcode.php
Last active June 14, 2018 19:17
WordPress human name ucwords shortcode (apply correct cases for human names)
<?php
# Include this file in your functions.php
add_shortcode('human-name', 'human_name');
add_shortcode('human_name', 'human_name');
add_shortcode('name', 'human_name');
function human_name($atts, $content = null) {
return HumanName::parse($content);
@almino
almino / data-model.ts
Last active March 19, 2018 02:08
Meus primeiros passos com Firestore
import { Address } from 'ngx-google-places-autocomplete/objects/address';
export interface Price {
value: number
date: Date
place?: Address
url?: URL
}
export interface Measurement {
@almino
almino / current-geolocation.ts
Last active July 16, 2020 04:39
place componnent
export class CurrentGeolocation {
public static getGeolocation(options?: any) : Promise<Position> {
if (window.navigator.geolocation) {
/* https://gist.github.com/varmais/74586ec1854fe288d393 */
return new Promise(function (resolve, reject) {
navigator.geolocation.getCurrentPosition(resolve, reject, options);
});
}
}
}