Skip to content

Instantly share code, notes, and snippets.

View claudiofreitas's full-sized avatar
🤠
Adventure

Claudio Freitas claudiofreitas

🤠
Adventure
  • Tokyo, Japan
  • 20:58 (UTC +09:00)
View GitHub Profile
const { app, safeStorage } = require('electron');
const { join } = require('node:path');
const { readFileSync, writeFileSync } = require('node:fs');
const folder = join(app.getPath('appData'), 'Signal');
app.setPath('userData', folder);
app.setName('Signal');
app.on('ready', () => {
const configPath = join(folder, 'config.json');
@melroy89
melroy89 / mastodon-docker-setup.md
Last active June 30, 2025 17:42 — forked from akuechl/mastodon-docker-setup.md
Mastodon Docker Setup - most complete and easiest guide online
@KATT
KATT / favourite-ts-tricks.md
Last active April 8, 2025 01:25
🧙‍♂️ Favourite non-obvious TS tricks

Record<string, x | undefined>

Represent maps

// rather than 
const map: {[ key: string ]: string} = {
  foo: 'bar',
}
@diegovarussa
diegovarussa / new_project_phpstorm.md
Last active July 12, 2018 08:00
Configuration for new project in PHPStorm using Docker
@bbshih
bbshih / momentMock.js
Last active February 22, 2023 18:27 — forked from lededje/gist:44aeddf1dc2a5e6064e3b29dc35a7a2d
Jest Mocking Moment to same time zone for tests
// To mock globally in all your tests, add to setupTestFrameworkScriptFile in config:
// https://facebook.github.io/jest/docs/en/configuration.html#setuptestframeworkscriptfile-string
jest.mock('moment', () => {
const moment = require.requireActual('moment-timezone');
moment.tz.setDefault('America/Los_Angeles'); // Whatever timezone you want
return moment;
});

TaskWarrior Quick Cheat Sheet

Last Update: 2017-01-11

Undelete a Task

task [id] modify end: status:pending

Undelete tasks that were deleted today

task +DELETED end:today modify end: status:pending
@ankurk91
ankurk91 / github_gpg_key.md
Last active June 30, 2025 18:17
Signing git commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --height 50% --min-height 20 --border --bind ctrl-/:toggle-preview "$@"
}
@bennofs
bennofs / doc.md
Last active March 25, 2025 18:15
Overview of the NixOS X11 session modules

How X11 is started

In the following example, sddm will be used as a display manager. The process is however similar for other display managers in nixpkgs and a summary that applies to all nixpkgs display managers is given at the end.

  1. Systemd unit "display-manager.service" starts services.x11.displayManager.job.execCmd (the display manager)

    Code reference: <nixpkgs>/nixos/modules/services/x11/xserver.nix

  2. services.x11.displayManager.job.execCmd is set to the path of the sddm binary from the sddm package in the nix store. So SDDM will start and read its configuration from /etc/sddm.conf.