Skip to content

Instantly share code, notes, and snippets.

@muppetjones
muppetjones / .vimrc
Last active Apr 9, 2022
Simple vimrc
View .vimrc
syntax enable
filetype plugin indent on
colorscheme delek
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" ================ General Config ====================
@muppetjones
muppetjones / README.md
Last active Mar 21, 2022
QMK Mouse Movement via Encoders
View README.md

Etch-a-mouse

> NOTE: This gist is deprecated. I've moved everything into /users/muppetjones, and I have an open PR on the QMK repo. Eventually, this will probably be merged, and I'll (hopefully) remember to update this note.

@muppetjones
muppetjones / config.h
Last active Jul 1, 2022
QMK Dynamic Layer Lighting
View config.h
/* (Optional) Define RGB settings in your config.h */
#ifdef RGBLIGHT_ENABLE
# define RGBLIGHT_ANIMATIONS
# define RGBLIGHT_HUE_STEP 8
# define RGBLIGHT_SAT_STEP 8
# define RGBLIGHT_VAL_STEP 8
# define RGBLIGHT_LIMIT_VAL 150
# define RGBLIGHT_SLEEP
// # define RGBLIGHT_LAYERS // We do NOT need the layers!
#endif
@muppetjones
muppetjones / sandbox_sys_exit.py
Created Jun 13, 2021
Edge Case for SystemExit
View sandbox_sys_exit.py
#!/usr/bin/env python3
"""Example SystemExit edge case.
Try:except blocks should always be as explicit as possible about the errors
the catch; however, sometimes you really just need to catch anything. When
this "anything" happens, always catch "Exception" -- never use a bare except.
"But a bare except is the only way to catch everything", you say?
Nope. You just need to be more explicit: SystemExit, KeyboardInterrupt,
@muppetjones
muppetjones / colsize.py
Last active Aug 27, 2018
Print length of column names in a file.
View colsize.py
#!/usr/bin/env python3
"""Print size of columns.
Usage:
$ python3 colsize.py ./ref_uniprot.csv
id: (1, 6)
ensembl_transcript_id: (0, 15)
feature_type: (4, 35)
feature_desc: (0, 747)
@muppetjones
muppetjones / FastQC_aggregate.sh
Last active Aug 29, 2015 — forked from danielecook/FastQC_aggregate.sh
Examine Fastqc reports in aggregate; brings images, statistics, and summaries together. #fastq
View FastQC_aggregate.sh
#!/bin/bash
# Run this script in project root--expected structure: `./fastqc/<sample>/*.zip`
# This script aggregates images of each type in individual folders
# o looking across data is quick.
zips=`ls fastqc/*/*.zip`
for i in $zips; do
unzip -oq -d "$(dirname "$i")" $i;
done
View kSNP3_cluster.sh
#!/bin/tcsh
#v3.91
########################################################################
# WHERE ARE ALL THE kSNP SCRIPTS?
# IF YOU INSTALLED kSNP ANYWHERE OTHER THAN /user/local THEN YOU MUST MODIFY THIS TO POINT TO THE DIRECTORY WHERE YOU HAVE INSTALLED kSNP SCRIPTS
set kSNP=/usr/local/kSNP3
#set kSNP=/g/g15/shea/kSNP3_Source
########################################################################
@muppetjones
muppetjones / setup_local_linux.sh
Last active Aug 29, 2015
Perform a local install of a variety of useful (e.g., necessary) softwares
View setup_local_linux.sh
#!/bin/bash
# Perform a local install of a variety of useful (e.g., necessary) softwares
#
# Ever had to use a server and found yourself frustrated due to lack of
# root access or simply not being able/allowed to modify the setup?
# Never fear!
#
# This script does the following:
# * Modifies *.vimrc to include line numbers and set tabs to four spaces
# * Install gcc-4.5.4 (and other required)
@muppetjones
muppetjones / slate_rotateApp.js
Last active Aug 29, 2015
Slate js Rotating App Focus
View slate_rotateApp.js
// slate_rotateApp.js
// Stephen J. Bush
// This snippet for slate js allows switching between a group of apps with a single keystroke.
// FIXED: Binding failed if an app in the list is not open.
// FIXED: Window object undefined for some apps or if window minimized.
// UPDATE: [12.05.14] Rotate now returns to the last used app in the group before rotating.
// NOTE: This only works when using the key binding as the 'windowFocused' event does not reliably trigger.
// TODO: Rotate between open windows for each app.
/*