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 / 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 / .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 / 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 / .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 / 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 / rpi3-install-py3-opencv.sh
Last active March 22, 2020 03:23
Py3 OpenCV on Raspberry Pi 3
# Remove useless programs to free up space
sudo apt-get remove --purge -y wolfram* libreoffice* sonic-pi minecraft-pi
sudo apt-get clean && sudo apt-get autoremove
# Update, upgrade, and install all OpenCV dependencies
sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt install libgdk-pixbuf2.0-dev libpango1.0-dev libcairo2-dev libfontconfig1-dev libgdk-pixbuf2.0-dev libpango1.0-dev libcairo2-dev # GTK requires
sudo apt-get install build-essential cmake pkg-config libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev libgtk2.0-dev libgtk-3-dev libatlas-base-dev gfortran python2.7-dev python3-dev # opencv requires
# virtualenv for Python, this is where OpenCV will be installed
sudo pip install virtualenv virtualenvwrapper
PROJECT_HOME=$HOME/Development
@seanpianka
seanpianka / combat.cpp
Created May 13, 2018 04:50
A game where spartans and skeletons fight! Idea from YouTube channel "MakingGamesWithBen" and his first challenge video!
/*
* Title: Spartan vs. Skeletons
* Author: Sean Pianka
* Date: November 3rd, 2015
* Description: A game where spartans and skeletons fight! Idea from
* YouTube channel "MakingGamesWithBen" and his first challenge video!
The game is based off of this tutorial, which I highly recommend to
anyone looking to get into programming and game development:
@seanpianka
seanpianka / hacking.cpp
Created May 13, 2018 04:48
A hacky, partially-working implementation of the Fallout video-game series hacking mini-game.
/*
** Game designed according to this challenge:
** https://www.reddit.com/r/dailyprogrammer/comments/3qjnil/20151028_challenge_238_intermediate_fallout/
*/
/*
************************************************************
// HEADER FILES
************************************************************
*/
@seanpianka
seanpianka / collatz.cpp
Created May 13, 2018 04:45
A C++ script written to generate sequences from the Collatz Conjecture, an open problem in mathematics.
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <ctime>
int main(int argc, char** argv)
{
int time_initial = 0,
time_final = 0,
@seanpianka
seanpianka / spotify_playing.py
Created May 13, 2018 04:38
A Python script which can display information for the currently playing track on Spotify for Linux.
import dbus
import time
session_bus = dbus.SessionBus()
spotify_bus = session_bus.get_object("org.mpris.MediaPlayer2.spotify",
"/org/mpris/MediaPlayer2")
spotify_properties = dbus.Interface(spotify_bus,
"org.freedesktop.DBus.Properties")