Skip to content

Instantly share code, notes, and snippets.

View mrmrs's full-sized avatar

Adam Morse mrmrs

View GitHub Profile
@mrmrs
mrmrs / sed-regex-question.json
Created October 28, 2015 10:31
Given the below json example - how would I replace the 7 characters with a different string after the hash for module2 from a unix command line?
{
"module": "git+https://9gke37d40a7a9f84659e98f386d4ea2fda2a5d86:x-oauth-basic@github.com/org-name/repo.git#71e84fd",
"module2": "git+https://9gke37d40a7a9f9999e98f386d4ea2fda2a5d86:x-oauth-basic@github.com/org-name/repo.git#99h43ae",
"module3": "git+https://9gke37d40a7a9f33759e98f386d4ea2fda2a5d6:x-oauth-basic@github.com/org-name/repo.git#94i53bb"
}
$nonpareille: 8px!default;
$minion: 9px!default;
$petit: 11px!default;
$bourgeois: 12px!default;
$long-primer: 13px!default;
$small-pica: 15px!default;
$pica: 16px!default;
$english: 19px!default;
$columbian: 21px!default;
$great-primer: 24px!default;
@mrmrs
mrmrs / .vimrc
Created February 11, 2013 07:34
My .vimrc file. More comments needed.
set nocompatible " Uses vim vs vi settings must be set first
syntax on " Turn on syntax highlighting for recognized filetypes
set title
set history=1000 " I fuckup a lot. I need more than 20 undos.
set wildmenu " Show me how many options I have to choose from on autocomplete
set number " Displays numbers on left of file
set visualbell " If I never hear that fucking beep again I'll be mad stocked. Unless it's in electronic music. Then it's fine.
set autoread " Reload files changed outside of vim
set hidden " Buffers can exist without being in window - hit :bn or :bp to toggle between buffers
set incsearch " find next match as we type the search
@mrmrs
mrmrs / Defaults.css
Created February 20, 2013 08:17
My defaults to override the browser defaults. CSS is so weird.
/*
DEFAULTS
*/
html, body, div, span,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, address, cite, code,
del, dfn, img, ins, kbd, q, samp,
@mrmrs
mrmrs / sf-colors.scss
Created February 21, 2013 00:22
Stitch Fix Colors
$green:#9ed7d1;
$yellow:#f2e230;
$dark-grey:#464547;
$medium-grey:#bebfc1;
@mrmrs
mrmrs / change-file-extension
Last active December 15, 2015 22:39
Rename all css files to scss. Could be used to change extension for any two file types.
for file in *.css
do
mv ${file} ${file%.css}.scss
done
@mrmrs
mrmrs / vim-random
Last active December 16, 2015 04:29
let @+=@" "This copies your latest buffer to clipboard
vim --version look for +clipboard
@mrmrs
mrmrs / html-css-nav
Created June 7, 2013 00:34
.vimrc mappings for super easy front-end file management. When your cursor is over a class name, press fj to step to the first definition of that class in your css/sass. Subsequently press cn to step through the quick-fix list results. These can obviously be mapped to anything you want. I like this combo personally.
map fj :execute "vimgrep /" . expand("<cword>") . "/j **" <Bar> cnext<CR>
map cn :cn<CR>
@mrmrs
mrmrs / favorite-vim.md
Created June 12, 2013 05:44
Examples of common tasks. Can be mapped to anything you want.

Delete all blank lines in a file

:g/^$/d

Delete trailing white space

:%s/\s+$//

" Smarter defaults
set nocompatible " Uses vim vs vi settings must be set first
syntax on " Turn on syntax highlighting for recognized filetypes
set history=1000 " Default is 20, I'd rather set this to ∞
set nofoldenable " Don't fold shit
set wildmenu " List outoptions for autocompleting commmands
set number " Adds line numbers
set visualbell " Never hear beep again === happy