Skip to content

Instantly share code, notes, and snippets.

View killtheliterate's full-sized avatar
🫀
pumping the bits

Garrett Dawson killtheliterate

🫀
pumping the bits
View GitHub Profile
@ageis
ageis / openpgp-card-guide.md
Last active November 6, 2024 14:28
Quick GPG Smartcard Guide
@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active December 29, 2024 07:04
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@cbankston
cbankston / .env.service
Created February 23, 2016 20:08
Node Docker Project
RDS_HOSTNAME=db
RDS_USERNAME=root
RDS_PASSWORD=some_pass
NODE_PATH=/app
MESSAGE_SERVICE_USERNAME=guest
MESSAGE_SERVICE_PASSWORD=guest
MESSAGE_SERVICE_PORT=5672
MESSAGE_SERVICE_VHOST=/
MESSAGE_SERVICE_HOST=rabbit
@hew
hew / _readme.md
Last active June 10, 2022 19:13
Operator Mono w/ Italics on OSX VIm

Operator Mono w/ Italics on OSX Vim

@hartzis
hartzis / Image.jsx
Last active April 15, 2019 23:17
react image component - utilizing recompose, handles errors
import React, { Component, PropTypes } from 'react';
import { setPropTypes, withState, lifecycle, mapProps, compose } from 'recompose';
export const ImageComponent = compose(
setPropTypes({ src: PropTypes.string.isRequired }),
withState('imgState', 'updateImgState', ({ src }) => ({ origSrc: src, currentSrc: src })),
lifecycle({
componentWillReceiveProps(nextProps) {
// if Image components src changes, make sure we update origSrc and currentSrc
if (nextProps.src !== nextProps.imgState.origSrc) {
@ateucher
ateucher / setup-gh-cli-auth-2fa.md
Last active May 3, 2024 11:06
Setup git on the CLI to use 2FA with GitHub

These are instructions for setting up git to authenticate with GitHub when you have 2-factor authentication set up. This authentication should be inherited by any GUI client you are using. These are intentionally brief instructions, with links to more detail in the appropriate places.

  1. Download and install the git command-line client (if required).

  2. Open the git bash window and introduce yourself to git (if required):

    git config --global user.name 'Firstname Lastname'
    git config --global user.email '[email protected]'
    
@gcanti
gcanti / fp-ts-technical-overview.md
Last active March 11, 2024 02:40
fp-ts technical overview

Technical overview

A basic Option type

// Option.ts

// definition
export class None {
  readonly tag: 'None' = 'None'
@milankorsos
milankorsos / redux-actions.ts
Last active January 10, 2025 19:22
Correct TypeScript typing example for Redux Thunk actions
import {Action, ActionCreator, Dispatch} from 'redux';
import {ThunkAction} from 'redux-thunk';
// Redux action
const reduxAction: ActionCreator<Action> = (text: string) => {
return {
type: SET_TEXT,
text
};
};
@busypeoples
busypeoples / Simplified-Redux-Reducers.js
Created January 2, 2018 23:21
Simplified Redux Reducers
import Maybe from 'folktale/maybe';
const Inc = 'Inc';
const Dec = 'Dec';
const IncBy = 'IncBy';
const IncFn = state => state + 1;
const DecFn = state => state - 1;
const IncByFn = (state, action) => state + action.incBy;
@donabrams
donabrams / checklist.txt
Last active April 25, 2018 23:16
General JWT approach that usually isn't terrible checklist
☐ Put JWT in a cookie
☐ HTTPOnly cookie
☐ Secure cookie
☐ Domain w/ a subdomain (never root)
☐ No authorization in the JWT body (look it up serverside ya lazy asses)
☐ Userid in cookie should NOT exist anywhere but auth service
☐ Short window ( < 15 min) for JWT authentication token
☐ Ability to deauthorize a refresh token chain serverside (but long life on a refresh token is OK)
☐ Ability to monitor requests by refresh token chain