Skip to content

Instantly share code, notes, and snippets.

View NileDaley's full-sized avatar

Nile Daley NileDaley

View GitHub Profile
@NileDaley
NileDaley / repos.md
Last active August 27, 2021 05:48
CD to repo using fzf (fuzzy search)

I use this little function on the command line to allow me to switch between different repositories easily using fzf

Prerequisits

  • fzf
  • zsh or bash

Installation

FZF

@NileDaley
NileDaley / AmethystCheatsheet.md
Last active September 21, 2020 10:19
A cheatsheet of shortcuts for Amethyst ( mac window manager )

Amethyst Keyboard Shortcuts

mod1: option + shift
mod2: ctrl + option + shift

Changing layouts

{
// Different cursor styles for each mode
"vim.cursorStylePerMode.insert": "line-thin",
"vim.cursorStylePerMode.normal": "block",
"vim.cursorStylePerMode.replace": "block-outline",
// Duh
"vim.disableExtension": false,
// Enable easymotion plugin and set the color and size of the markers
@NileDaley
NileDaley / i18n-type-safety.ts
Created May 14, 2020 10:55
Adds type safety to i18n.t() function based on the keys of the "en" locale file
import i18n from 'i18next'
import LanguageDetector from 'i18next-browser-languagedetector'
import { initReactI18next } from 'react-i18next'
import * as locales from '../locales/index'
import * as momentConfig from './moment'
const resources = locales;
i18n.use(LanguageDetector) // Detect the language from the ?lang param
@NileDaley
NileDaley / handle.ts
Created May 7, 2019 12:28
Utils - Typescript
type HandleResponse<T> = HandleResult<T> | HandleError;
type HandleResult<T> = [null, T];
type HandleError = [Error, null];
export const handle = async <T = any>(prom: Promise<T>): Promise<HandleResponse<T>> => {
try {
const res = await prom;
return [null, res] as HandleResult<T>;
} catch (err) {
return [err, null] as HandleError;
@NileDaley
NileDaley / tslint.json
Created April 10, 2018 10:52
TSLint.json
{
"rulesDirectory": ["node_modules/codelyzer"],
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"comment-format": [true, "check-space"],
"curly": true,
"eofline": true,
"forin": true,