Skip to content

Instantly share code, notes, and snippets.

View seanpianka's full-sized avatar
🦀
Busy

Sean Pianka seanpianka

🦀
Busy
  • Somewhere in Cislunar Space
  • LinkedIn in/pianka
View GitHub Profile
@seanpianka
seanpianka / clock.py
Created June 17, 2018 01:18
Stopwatch
import copy
import time
import sys
class StopyException(Exception):
pass
class IncompatibleStatesError(StopyException):
pass
@seanpianka
seanpianka / .vimrc
Last active October 31, 2018 22:08
quickstart vim
set term=xterm-256color
map <space> viw
" Swap to the left-adjacent vim tab
nnoremap <left> gT
" Swap to the right-adjacent vim tab
nnoremap <right> gt
" escape should be easier to get to
inoremap jj <ESC>
" Disables cursor movement with arrow keys
inoremap <up> <nop>
@seanpianka
seanpianka / Oauth2.md
Created July 19, 2018 16:55 — forked from mziwisky/Oauth2.md
Oauth2 Explanation

OAUTH2

The Problem

I’m a web app that wants to allow other web apps access to my users’ information, but I want to ensure that the user says it’s ok.

The Solution

I can’t trust the other web apps, so I must interact with my users directly. I’ll let them know that the other app is trying to get their info, and ask whether they want to grant that permission. Oauth defines a way to initiate that permission verification from the other app’s site so that the user experience is smooth. If the user grants permission, I issue an AuthToken to the other app which it can use to make requests for that user's info.

Note on encryption

Oauth2 has nothing to do with encryption -- it relies upon SSL to keep things (like the client app’s shared_secret) secure.

@seanpianka
seanpianka / .zshrc
Last active August 13, 2019 18:07
zsh configuration file (.zshrc)
export ZSH=$HOME/.oh-my-zsh
ZSH_THEME="af-magic"
plugins=(git)
source $ZSH/oh-my-zsh.sh
export TERM=xterm-256color
export EDITOR=vim
# Custom paths for scripts to ~/.bin
export PATH=$PATH:~/Development/Vindicta/drivers
# zsh: jump back/forward on CLI
@seanpianka
seanpianka / onScrollTransparentNavbar.vue
Created June 14, 2019 20:09
Vue.js vuetify make navbar transparent after scrolling from top
<template>
<div id="navbar">
<v-toolbar app fixed :class="{'elevation-0': this.navbar_transparent}">
<v-toolbar-title>
App Name
</v-toolbar-title>
<v-spacer></v-spacer>
<v-toolbar-items>
@seanpianka
seanpianka / https_redirect.config
Created June 15, 2019 21:00
apache compression, https forward, cache expiration/cache control
files:
"/etc/httpd/conf.d/ssl_rewrite.conf":
mode: "000644"
owner: root
group: root
content: |
RewriteEngine On
<If "-n '%{HTTP:X-Forwarded-Proto}' && %{HTTP:X-Forwarded-Proto} != 'https'">
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</If>
@seanpianka
seanpianka / .tmux.conf
Created August 13, 2019 18:08
tmux configuration file
bind J resize-pane -D 5
bind K resize-pane -U 5
bind H resize-pane -L 5
bind L resize-pane -R 5
bind M-j resize-pane -D
bind M-k resize-pane -U
bind M-h resize-pane -L
bind M-l resize-pane -R
@seanpianka
seanpianka / vim-grep.zsh
Last active August 26, 2019 22:18
Combine vim and grep to quickly open files containing expression/pattern in vim
# vim-grep, open all files containing grepped string
function vim-grep {
GREP_OPTIONS="-rnw $1 -e $2"
for var in "${@:3}";
do
GREP_OPTIONS+=" --include \"$var\""
done
vim $(eval "grep $GREP_OPTIONS" | cut -f1 -d: | uniq | tr "\n" " ")
@seanpianka
seanpianka / setup_mac.sh
Last active September 1, 2019 12:42
Bash script to install everything needed for my Mac, save my configuration files
#!/bin/bash
SPECTACLE_VERSION="1.2"
RDM_VERSION="2.2"
install_brew=false
install_utils=true
install_dev_tools=true
install_webdev_tools=true
@seanpianka
seanpianka / intellij-vuejs-module-not-installed-error.txt
Last active March 12, 2022 08:05
JetBrains WebStorm vue.js, "Module is not installed", fix "@" in imports
https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000556284/comments/360000146344
Specify the absolute path to `node_modules/@vue/cli-service/webpack.config.js` as a webpack config under `Languages & Frameworks / Javascript / Webpack`.