Skip to content

Instantly share code, notes, and snippets.

View ramnes's full-sized avatar

Guillaume Gelin ramnes

View GitHub Profile
#include "keymap_common.h"
/*
Shane's Planck Layout
http://www.keyboard-layout-editor.com/#/layouts/015d9011102619d7695c86ffe57cf441
*/
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = KEYMAP( /* Base */
TAB, Q, W, E, R, T, Y, U, I, O, P, MINS,
#!/usr/bin/env python3
"""xev output data parser to get mouse polling rate.
Usage:
$ chmod a+x mouserate
$ xev | mouserate
"""
import sys
import re
@amcgregor
amcgregor / mongodb-faq.md
Last active November 9, 2016 14:27
A FAQ giving more detail than you ever wanted to know on a variety of MongoDB subjects.

Alice's MongoDB FAQ

Personal

Which operating system do you use for your servers?

I use Gentoo Linux, for a wide variety of reasons. Performance is a big one, with the least amount of RAM utilized on startup after a fresh install, startup times to all-services-responding of around four seconds, and broad support for operation in a cluster: distributed computing. By default it compiles packages from source, allowing the installed packages to be highly optimized for the physical hardware it is running on, however it also integrates binary package support and distributed compiling allowing one "master" host to orchestrate compilation across an entire cluster. This results in "from depclean" kernel compiliation times in the order of 40 seconds in my production cluster. I SSHFS mount the package directory from the master on the other hosts and simply install the binary packages it produces.

Hand-installing a new Gentoo build takes around ten minutes on a reasonably powered VM

@Airblader
Airblader / py3lock.py
Created May 11, 2015 16:41
Obscure only actual windows for i3lock
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
# vim:ts=2:sw=2:expandtab
import os
import xcb
from xcb.xproto import *
from PIL import Image
XCB_MAP_STATE_VIEWABLE = 2
@PurpleBooth
PurpleBooth / README-Template.md
Last active November 5, 2025 16:18
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@bersace
bersace / py.sh
Last active December 30, 2015 15:27
Script python exécutable et sourceable par bash
#!/bin/bash
## -*- python -*-
#
# This python script is callable and sourceable by bash.
#
# lint python with: flake8 --ignore=E225,E265 py.sh
# lint bash with: sed '/^## END BASH/,$d' py.sh | shellcheck -
## In bash, declare a variable script, assign value "#". In python, declare a
## variable scriptd, assign a heredoc containing the bash script.
@NelsonMinar
NelsonMinar / python-json-types.py
Created January 10, 2016 23:07
Testing various dict wrappers for Python JSON
"""
Various options for a JSON type for Python.
My best effort at using these libraries naturally for reading and writing JSON.
https://nelsonslog.wordpress.com/2016/01/08/a-better-python-object-for-json/
"""
import json, copy
import dotmap, attrdict, easydict, addict
@jcberthon
jcberthon / networkmanager-wifi-powersave.md
Last active September 15, 2025 16:56
NetworkManager Wi-Fi powersaving configuration

NetworkManager WiFi Power Saving

NetworkManager supports WiFi powersaving but the function is rather undocumented.

From the source code: wifi.powersave can have the following value:

  • NM_SETTING_WIRELESS_POWERSAVE_DEFAULT (0): use the default value
  • NM_SETTING_WIRELESS_POWERSAVE_IGNORE (1): don't touch existing setting
  • NM_SETTING_WIRELESS_POWERSAVE_DISABLE (2): disable powersave
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active November 11, 2025 21:23 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export your tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@tadly
tadly / rofi-emoji.sh
Last active September 8, 2025 17:39
Rofi emoji picker
#!/usr/bin/env bash
#
# Use rofi to pick emoji because that's what this
# century is about apparently...
#
# Requirements:
# rofi, xsel, xdotool, curl, xmllint
#
# Usage:
# 1. Download all emoji