Skip to content

Instantly share code, notes, and snippets.

View ishabo's full-sized avatar

Joshua ishabo

  • YodaTek LTD
  • London
View GitHub Profile
@ishabo
ishabo / .tmux.conf
Last active January 21, 2025 13:48
My .tmux.conf - linux
unbind r
bind r source-file ~/.tmux.conf
set -g mouse on
# set-option -g default-shell /opt/homebrew/bin/zsh
unbind C-b
set-option -g prefix M-z
@ishabo
ishabo / .vimrc
Last active January 21, 2025 14:09
.vimrc
let mapleader=","
source ~/.cocrc
call plug#begin()
" Autocompletion
Plug 'neoclide/coc.nvim', { 'branch': 'release' }
Plug 'Shougo/vimproc.vim', {'do' : 'make'} " Interactive command execution in Vim.
" Source Control
Plug 'airblade/vim-gitgutter'
@ishabo
ishabo / .cocrc
Last active January 20, 2025 16:58
My .cocrc
inoremap <expr> <CR> pumvisible() ? "\<C-Y>" : "\<CR>"
function! CheckBackSpace() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction
" Insert <tab> when previous text is space, refresh completion if not.
inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#pum#next(1):
@ishabo
ishabo / machine.js
Last active September 7, 2021 15:56
Generated by XState Viz: https://xstate.js.org/viz
const LIMIT = 10000;
const isLessOrEqualToZero = (amount) => amount <= 0;
const isMoreThanLimit = (amount) => amount > LIMIT;
const isAmountValid = (ctx) => !ctx.error;
const addCash = assign((ctx, event) =>({
amount: event.payload.amount
@ishabo
ishabo / machine.js
Last active August 26, 2021 16:27
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@ishabo
ishabo / machine.js
Last active August 23, 2021 17:12
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@ishabo
ishabo / machine.js
Last active August 24, 2021 14:45
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@ishabo
ishabo / machine.js
Last active June 14, 2021 16:27
Generated by XState Viz: https://xstate.js.org/viz
////////////////////////////////////////////////
// HELPERS
////////////////////////////////////////////////
const todaysDate = new Date();
const zeroPad = (num, places) => String(num).padStart(places, '0');
const calculateDateAfterYears = (d, years) => {
return new Date(`${zeroPad(d.getDate(), 2)}-${zeroPad(d.getMonth(), 2)}-${d.getFullYear() + years}`);
@ishabo
ishabo / machine.js
Last active June 8, 2021 09:18
Generated by XState Viz: https://xstate.js.org/viz
////////////////////////////////////////////////
// HELPERS
////////////////////////////////////////////////
const todaysDate = new Date();
const zeroPad = (num, places) => String(num).padStart(places, '0');
const getDateInYears = (years, d) => {
@ishabo
ishabo / machine.js
Created January 12, 2021 14:42
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions