Skip to content

Instantly share code, notes, and snippets.

View feltnerm's full-sized avatar

Mark Feltner feltnerm

View GitHub Profile
@feltnerm
feltnerm / Dockerfile
Last active February 21, 2023 08:36
Docker + MySQL + `lower_case_table_names=1`
FROM mysql
ADD my.cnf /etc/mysql/my.cnf
CMD ["mysqld", "--datadir=/var/lib/mysql", "--user=mysql"]
@feltnerm
feltnerm / dotfileback
Created April 19, 2011 05:48
Backup dotfiles to github
#!/usr/bin/env python
"""
backup_dotfiles.py
Copies dotfiles over (.zshrc, .screenrc, etc.) to a backup dir
and syncs them with github.
"""
import argparse
@feltnerm
feltnerm / SomeHaskell.hs
Created December 18, 2012 17:37
Some Haskell problems that I did for fun
{--
-
- @author: Mark Feltner
-
- **Haskell**
-
- Haskell is a nice language. I enjoyed it better than F# for functional
- programming.
- From my limited perspective, it seems that Haskell would operate best
- in a highly theoretical or mathematical environment; not the environment
@feltnerm
feltnerm / m2u2dir
Created April 19, 2011 05:37
Useful for Djs to not screw with their real mp3s -- versions for python 2.7 and 2.6
#!/usr/bin/env python
"""
m3u2dir.py
Copies the files found in a .m3u file
to either the current working dir or a dir
specified on the command line.
IDEAS:
automatically find .m3u in current working dir
@feltnerm
feltnerm / mp6.ada
Created December 8, 2012 01:43
Ada program that supports adding and subtracting arbitrary-sized integers - "Bignum"s in Ruby. The program will read two numbers and print the result of adding and subtracting them. The numbers can be positive or negative. The implementation uses linked lists.
pragma License (Gpl);
-- BigIntegers - Package Specification
--
-- Package to define operations on BigIntegers
-- ###########################################################################
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
package BigIntegers is
@feltnerm
feltnerm / kubectl-aliases.sh
Last active September 18, 2019 19:25
Add the following to your `~/.zshrc`. Assumes you have docker installed, a valid `~/.kube/config` file, and a valid `~/.aws/config` and `~/.aws/credentials`.
## kubernetes
K8S_DOCKER_IMAGE_VERSION=1.1.0-20190426 #1.0.2
K8S_CLI="docker run --tty --interactive --rm \
--user $(id -u) \
-v ~/.kube:/config/.kube \
-v ~/.aws:/config/.aws \
quay.io/widen/k8s:$K8S_DOCKER_IMAGE_VERSION"
alias kubectl="$K8S_CLI kubectl $@"
alias helm="$K8S_CLI helm $@"

Keybase proof

I hereby claim:

  • I am feltnerm on github.
  • I am feltnerm (https://keybase.io/feltnerm) on keybase.
  • I have a public key whose fingerprint is 3962 466C 0962 591E D31A 53DC AEF4 312F 8982 EF2A

To claim this, I am signing this object:

@feltnerm
feltnerm / keyboard-shortcuts.md
Last active January 3, 2017 19:51
Development environment (fish, vim, tmux) keyboard shortcuts I use.

vim

unite

  • p grep
  • pf file_rec/async
  • pr file_mru
  • pb buffer
  • pg grep/git
  • pG file_rec/git
@feltnerm
feltnerm / createProgressReducer.js
Created September 7, 2016 03:25
automatically store the state (pending, rejected, fulfilled) of promissory actions in a place in the redux store.
import { handleActions } from 'redux-actions'
import methods from 'actions' // `methods` are all the UPPERCASE_STRING constants defining action strings.
export const createProgressReducer = (options = {}) => {
const initialState = {}
const progressReducer = Object.keys(methods).reduce((accum, method) => {
if (typeof method === 'string') {
accum[`${method}_PENDING`] = (state, action) => {
return {
@feltnerm
feltnerm / Fine Uploader 101
Created November 19, 2013 15:00
Fine Uploader 101
# Fine Uploader 101
## Intro
Hello! ...
### Server
Download server as zip and extract