Skip to content

Instantly share code, notes, and snippets.

@ooade
ooade / machine.js
Created July 18, 2020 00:03
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@ooade
ooade / machine.js
Created July 16, 2020 17:10
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@ooade
ooade / README.md
Created June 23, 2020 19:53
JSON Viewer extension in dark mode.

How to apply

  • Click on the settings icon.
  • Build custom theme with style editor.
  • Paste the stylesheet.
@ooade
ooade / doormat.py
Created November 22, 2019 10:11
Hackerrank Door mat
# Enter your code here. Read input from STDIN. Print output to STDOUT
n, m = input().split()
n = int(n)
m = int(m)
extra = 0
reversed_iteration = False
tracker = []
for i in range(0, n):
@ooade
ooade / solution.py
Created November 21, 2019 08:34
Python Swap Case
def swap_case(s):
result = ''
for i, letter in enumerate(s):
if letter.islower():
result += letter.upper()
else:
result += letter.lower()
return result
@ooade
ooade / solution.py
Created November 21, 2019 08:19
Python lists Hackerrank
if __name__ == '__main__':
N = int(input())
mylist = []
for _ in range(N):
command, *numbers = input().split()
if command == 'print':
print(mylist)
@ooade
ooade / enumerate.js
Created October 26, 2019 18:20
Exactly like python's enumerate function
let enumerate = string => string.split('').map((v, i) => [i, v]);
@ooade
ooade / .gitconfig
Created May 27, 2019 11:41
Git Config
[user]
email = [email protected]
name = Ademola Adegbuyi
[color]
ui = true
[alias]
mylog = log --graph --decorate --pretty=oneline --abbrev-commit --all
s = status -s
[core]
editor = gedit
@ooade
ooade / .bash_aliases
Created May 27, 2019 09:08
Bash Aliases
# Add each alias on separate lines
# Git Aliases
alias gac="git add . && git commit -m" #Add all and commit
alias gcb="git checkout -b" #Check out to a specific branch
alias gp="git push origin HEAD" #Push commits to the current HEAD
alias gpom="git push origin master" #Push commits to master branch
alias gl="git pull" #Pull commits; Origin and Branch should be specified
alias glom="git pull origin master" #Pull the master branch
alias gri="git rebase -i" #Interactive rebase; Specify HEAD
@ooade
ooade / settings.json
Last active May 27, 2019 08:52
VSCode Settings
{
"atomKeymap.promptV3Features": true,
"editor.fontFamily": "'Ubuntu Mono' , 'Droid Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'",
"editor.fontLigatures": true,
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.insertSpaces": false,
"editor.multiCursorModifier": "ctrlCmd",
"editor.tabCompletion": "on",
"editor.tabSize": 2,