Skip to content

Instantly share code, notes, and snippets.

View fdidron's full-sized avatar

Florian Didron fdidron

View GitHub Profile
" Space as leader key
let mapleader = " "
" Sensible defaults
set nocompatible
set autoread
" Swap directory
set directory=$HOME/.vim/swp/
@fdidron
fdidron / api.js
Last active July 29, 2020 07:01
Rails API wrapper with Authenticity token
//This assumes the following script tag exists in
// the layout/application.html.erb head:
//<script charset="utf-8" type="text/javascript">
// window.__APP_CONFIG__ = {};
// __APP_CONFIG__.csrfToken = '<%= form_authenticity_token %>';
//</script>
async function api(url, method = "GET", data = {}) {
const payload = { ...data, authenticity_token: __APP_CONFIG__.csrfToken };
const endpoint =
method === "GET" && payload
@fdidron
fdidron / init.vim
Last active December 24, 2020 08:39
Init vim
" Space as leader key
let mapleader = " "
" Sensible defaults
set nocompatible
set autoread
" Swap directory
set directory=$HOME/.vim/swp/
@fdidron
fdidron / keymap.c
Created March 6, 2019 01:23
Ergodox EZ: Disable autoshift per layer
#include "ergodox_ez.h"
#include "debug.h"
#include "action_layer.h"
#include "version.h"
#include "keymap_german.h"
#include "keymap_nordic.h"
#include "keymap_french.h"
#include "keymap_spanish.h"
enum custom_keycodes {
@fdidron
fdidron / ABOUT.md
Last active April 9, 2024 23:53
Ergodox-EZ Glow per layer / per key illumination

rules.mk

Contains all the directives required to activate QMK's rgb matrix features.

config.h

Sets a constant required to read the rgb matrix config from the EEPROM.

keymap.c

Custom keymap based on my layout. This is where the magic happens.

First let's declare a rgb_matrix_config variable of type rgb_config_t :

CREATE OR REPLACE FUNCTION slugify("value" TEXT)
RETURNS TEXT AS $$
SELECT regexp_replace(
trim(
lower(
regexp_replace(
unaccent("value"),
E'[^\\w\\s-]',
'',
'gi'
@fdidron
fdidron / .eslintrc
Last active January 12, 2018 02:40
// Install: npm install --save-dev eslint-config-idiomatic eslint-plugin-react --save-exact
{
"env": {
"es6": true,
"jest": true
},
"extends": "idiomatic",
"parserOptions": {
"ecmaFeatures": {
@fdidron
fdidron / App.js
Last active April 11, 2023 13:54
React Router v4 Auth
//Usage
import React from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import Route from './AuthRoute';
import Login from './Login';
import Private from './Private';
export default () =>
<Router>
@fdidron
fdidron / error.trace
Created January 12, 2017 00:44
Hyper Aur Yarn error Log
Installing app dependencies for arch x64 to /tmp/yaourt-tmp-florian/aur-hyper/src/hyper-1.1.0/app
Error: /usr/bin/node exited with code 1
Output:
yarn install v0.18.1
[1/4] Resolving packages...
[2/4] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error output:
error https://github.com/Tyriar/pty.js/tarball/c75c2dcb6dcad83b0cb3ef2ae42d0448fb912642: Bad hash. Expected "a6ae3472bd63d7a5c489699fa7b50de160d97bd5" but got "78b09a52820f7306dc809343f0160b6e6b0592c5"
@fdidron
fdidron / document.body.style.json
Created October 22, 2016 05:20
document.body.style object export Chrome OS X v53.0.2785.143 (64-bit)
{
"alignContent": "",
"alignItems": "",
"alignSelf": "",
"alignmentBaseline": "",
"all": "",
"animation": "",
"animationDelay": "",
"animationDirection": "",
"animationDuration": "",