Skip to content

Instantly share code, notes, and snippets.

View lorenzorapetti's full-sized avatar

Lorenzo Rapetti lorenzorapetti

  • Rome, Italy
View GitHub Profile
### ZSH Options
zle_highlight+=(paste:none)
### Added by Zinit's installer
if [[ ! -f $HOME/.zinit/bin/zinit.zsh ]]; then
print -P "%F{33}▓▒░ %F{220}Installing %F{33}DHARMA%F{220} Initiative Plugin Manager (%F{33}zdharma/zinit%F{220})…%f"
command mkdir -p "$HOME/.zinit" && command chmod g-rwX "$HOME/.zinit"
command git clone https://github.com/zdharma/zinit "$HOME/.zinit/bin" && \
print -P "%F{33}▓▒░ %F{34}Installation successful.%f%b" || \
{
"Use Non-ASCII Font" : false,
"Tags" : [
],
"Ansi 12 Color" : {
"Red Component" : 0.3333333432674408,
"Color Space" : "sRGB",
"Blue Component" : 1,
"Alpha Component" : 1,
tap "heroku/brew"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-fonts"
tap "homebrew/core"
brew "autoconf"
brew "automake"
brew "bat"
brew "coreutils"
brew "deno"
// The ESLint browser environment defines all browser globals as valid,
// even though most people don't know some of them exist (e.g. `name` or `status`).
// This is dangerous as it hides accidentally undefined variables.
// We blacklist the globals that we deem potentially confusing.
// To use them, explicitly reference them, e.g. `window.name` or `window.status`.
const restrictedGlobals = require('confusing-browser-globals');
module.exports = {
root: true,
@lorenzorapetti
lorenzorapetti / dz60_keymap.json
Last active September 14, 2019 12:12
DZ60 Keymap for QMK firmware
{
"keyboard": "dz60",
"keymap": "dz60_layout_directional_mine",
"layout": "LAYOUT_directional",
"layers": [
[
"KC_GESC",
"KC_1",
"KC_2",
"KC_3",
@lorenzorapetti
lorenzorapetti / useFetch.tsx
Created November 19, 2018 12:54
React fetch hooks
import { useState, useEffect } from 'react';
export interface UseFetch<T> {
data: T | null;
isLoading: boolean;
error: ResponseError | Error | null;
retries: number;
retry: () => void;
}
@lorenzorapetti
lorenzorapetti / cloudSettings
Last active August 24, 2020 12:55
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-08-24T12:55:44.715Z","extensionVersion":"v3.4.3"}
@lorenzorapetti
lorenzorapetti / BaseModel.js
Created February 18, 2018 16:57
Custom validation in objection.js
const { Model, AjvValidator } = require('objection');
const pluralize = require('pluralize');
class BaseModel extends Model {
/**
* Always use timestamps as default
*/
static get timestamps() {
return true;
}
@lorenzorapetti
lorenzorapetti / .zshrc
Last active October 16, 2017 14:38
Zsh config
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
source ~/.fonts/*.sh
# Path to your oh-my-zsh installation.
export ZSH=/Users/lorenzorapetti/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@lorenzorapetti
lorenzorapetti / .rubocop.yml
Last active April 5, 2017 14:53
Rubocop configuration
AllCops:
TargetRubyVersion: 2.4
TargetRailsVersion: 5.0.2
Rails:
Enabled: true
Lint/AmbiguousBlockAssociation:
Enabled: false