Skip to content

Instantly share code, notes, and snippets.

@t0mab
t0mab / pylance_patcher.rs
Created April 30, 2024 08:04 — forked from pickx/pylance_patcher.rs
Patch Pylance's VSCode check
#!/usr/bin/env -S cargo +nightly -Zscript --quiet
---
[package]
edition = "2021"
[dependencies]
eyre = "0.6.12"
home = "0.5.9"
---
@t0mab
t0mab / jq-cheetsheet.md
Created March 30, 2022 10:19 — forked from olih/jq-cheetsheet.md
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq

@t0mab
t0mab / Efficient Encrypted UEFI-Booting Arch Installation
Created April 26, 2019 20:22 — forked from HardenedArray/Efficient Encrypted UEFI-Booting Arch Installation
An effcient method to install Arch Linux with encrypted root and swap filesystems and boot from UEFI. Multi-OS, and VirtualBox, UEFI-booting are also supported.
# OBJECTIVE: Install Arch Linux with encrypted root and swap filesystems and boot from UEFI.
# Note this encrypted installation method, while perfectly correct and highly secure, CANNOT support encrypted /boot and
# also CANNOT be subsequently converted to support an encrypted /boot!!! A CLEAN INSTALL will be required!
# Therefore, if you want to have an encrypted /boot or will want an encrypted /boot system at some point in the future,
# please ONLY follow my encrypted /boot installation guide, which lives here:
Installing Arch:
sudo vim /etc/pacman.conf
Update packages list: sudo pacman -Syy
run sudo pacman -Syu before installing any software (to update the repositories first)
* Timing issue:
- Change hardware clock to use UTC time:
sudo timedatectl set-local-rtc 0
@t0mab
t0mab / memoize.py
Created July 3, 2018 09:37 — forked from martync/memoize.py
Memoize Django model's method.
import functools
def memoize_django_model_method(obj):
@functools.wraps(obj)
def memoizer(*args, **kwargs):
# Get the model instance
instance = args[0]
@t0mab
t0mab / rofi-emoji.sh
Created February 24, 2018 00:55 — forked from tadly/rofi-emoji.sh
Rofi emoji picker
#!/usr/bin/env bash
#
# Use rofi to pick emoji because that's what this
# century is about apparently...
#
# Requirements:
# rofi, xsel, curl, xmllint
#
# Usage:
# 1. Download all emoji
@t0mab
t0mab / Pure CSS search input.markdown
Created July 3, 2017 21:57
Pure CSS search input
@t0mab
t0mab / VagrantFile.rb
Created June 9, 2017 00:10 — forked from marktheunissen/VagrantFile.rb
Running Ansible on a Vagrant machine without a plugin
Vagrant::Config.run do |config|
config.vm.define :default do |tw_config|
tw_config.vm.box = "precise64"
tw_config.vm.box_url = "http://files.vagrantup.com/precise64.box"
tw_config.vm.provision :shell, :path => "provision/ansible-setup.sh"
tw_config.vm.provision :shell, :path => "provision/controller-setup.sh"
# Load a local setup file if it exists, so you can use it to
# provide additional provisioning steps.
@t0mab
t0mab / snippets.cson
Created April 19, 2017 09:06
Atom snippet pour Schnapsum ! (aller dans Atom -> snippets -> c/c)
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#