Skip to content

Instantly share code, notes, and snippets.

View erbmicha's full-sized avatar

Michael Erb erbmicha

View GitHub Profile
@erbmicha
erbmicha / gist:5066232
Created March 1, 2013 17:22
CSS using background-origin to keep background-image tied to content
/* lined paper example */
line-height: 1.2;
background-image: linear-gradient(rgba(0,0,0,.3) 1px, transparent 1px);
background-size: 100% 1.2em;
background-position: 0 .8em;
background-origin: content-box;
padding: 1em;
/* code editor example */
line-height: 1.5;
@erbmicha
erbmicha / gist:5065695
Created March 1, 2013 16:14
CSS lightbox-type open/close transitions
.lightbox { transition: 1s width, 1s 1s height; }
.lightbox.current { transition: 1s height, 1s 1s width; }
@erbmicha
erbmicha / gist:5065682
Created March 1, 2013 16:13
CSS technique for utilizing calc to center content inside a container instead of using 'margin:0 auto' on all elements inside the container.
.section {
width: 700px;
padding: 1em calc(50% - 350px);
}
@erbmicha
erbmicha / gist:5065592
Last active December 14, 2015 09:29
CSS page indent shadow at top/bottom for scrolling section
/* top and bottom */
background:
linear-gradient(hsla(0,0%,100%,0) 15px, white 40px),
linear-gradient(to top, hsla(0,0%,100%,0) 15px, white 40px) bottom;
radial-gradient(at 50% 0, rgba(0,0,0,.2), transparent 70%),
radial-gradient(at 50% 100%, rgba(0,0,0,.2), transparent 70%) bottom;
background-repeat: no-repeat;
background-size: 100% 50%, 100% 50%, 100% 14px, 100% 14px;
background-attachment: local, local, scroll, scroll;
@erbmicha
erbmicha / gist:3916892
Created October 19, 2012 08:15
Tweetbot for Mac Super Secret Settings
Tweetbot for Mac Super Secret Settings
You will need to use the Terminal app to change these settings:
# these all affect the text in a DM or new tweet - the default is yes for all of them
defaults write com.tapbots.TweetbotMac TextAutomaticQuoteSubstitution -bool NO
defaults write com.tapbots.TweetbotMac TextAutoCorrect -bool NO
defaults write com.tapbots.TweetbotMac TextContinuousSpellChecking -bool NO
defaults write com.tapbots.TweetbotMac TextAutomaticTextReplacement -bool NO
@erbmicha
erbmicha / compile_xibs
Created May 27, 2012 04:08
Compile XIB files into NIB files for RubyMotion projects
#!/bin/bash
XIBS="*.xib
app/*.xib
interfaces/*.xib
resources/*.xib"
for i in $XIBS
do
echo "Compiling `basename $i`..."
ibtool --compile resources/`basename -s .xib $i`.nib $i
@erbmicha
erbmicha / .bashrc
Created May 27, 2012 02:06
My .bashrc file
# ALIASES
alias gitl="git log --oneline --decorate"
alias gits="git status -sb"
alias gu="git-up"
alias flushdns="dscacheutil -flushcache"
alias removesvn="find . -name .svn -print0 | xargs -0 rm -rf"
alias restartfinder="killall Finder && open /System/Library/CoreServices/Finder.app"
alias rrr="QUEUE=report_queue bundle exec rake environment resque:work"
alias ll="ls -alG"
alias show_library="chflags nohidden ~/Library/"
@erbmicha
erbmicha / gist:2795923
Created May 27, 2012 02:02
My Janus plugins
Tomorrow-Night
bufkill.vim
tabular
vim-less
vim-pasta
vim-ragtag
vim-rvm
vim-rake
vim-bundler
vim-ruby-debugger
@erbmicha
erbmicha / .gvimrc.after
Created May 27, 2012 01:57
My .gvimrc.after file for Janus
" Remove the scrollbars on MacVim
set guioptions=aAce
" set the default font
set guifont=DejaVu_Sans_Mono:h12
" Turn off balloons. They drive me nuts on Ruby files
set noballooneval
" Command-T OS-X Menu mapping turned back on. I like it better this way.
@erbmicha
erbmicha / .vimrc.after
Last active October 5, 2015 10:47
My .vimrc.after file for Janus
" bind control-l to hashrocket
imap <C-l> <Space>=><Space>
" convert word into Ruby symbol
imap <C-k> <C-o>b:<Esc>Ea
nmap <C-k> lbi:<Esc>E
" folding settings
set foldmethod=indent "fold based on indent
set foldnestmax=10 "deepest fold is 10 levels