Skip to content

Instantly share code, notes, and snippets.

Avatar

Martin Grenfell scrooloose

View GitHub Profile
View notes.md

sudo apt-get install build-essential ruby-dev libxml++2.6-dev libsqlite3-dev nodejs sudo gem install rails cd /tmp rails new test cd test rails server

now go to http://localhost:3000 in your browser, you should see a welcome page.

View epic_hacks.vim
"stick this shit in a markdown ftplugin
"
"Usage:
"
"Open a markdown file.
"Use the :MdLive command.
"Save the file and it will update
command MdLive call s:InitMarkdownHacks()
autocmd bufwritepost <buffer> call s:CheckToBuildMd()
View hacks.css
@media (max-width: 450px) {
.top-block .text-holder {
font-size: 16px;
font-weight: normal;
}
}
View css.css
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS and IE text size adjust after device orientation change,
* without disabling user zoom.
*/
html {
font-family: sans-serif; /* 1 */
View foo.vim
"project dir filtering for nerdtree (stick in vimrc)
autocmd vimenter * call s:setupPathFilter()
function! s:setupPathFilter() abort
call NERDTreeAddPathFilter("ProjectPathFilter")
let baseDir = "/home/marty/work/playmob/charity_portal/website"
let s:proj = { 'root': g:NERDTreePath.New(baseDir) }
let s:proj['visibleDirs'] = [
View projects.vim
" Usage:
"
" Create a project from the current nerdtree with
" :NERDTreeProjectSave <name>
"
" Load a project with
" :NERDTreeProjectLoad <name>
"
" Delete a project with
" :NERDTreeProjectRm <name>
View nerdtree_ft_checker.vim
"Put this file in ~/.vim/nerdtree_plugin
"
"There are definitely more efficient ways to check a file to see if it
"is a class/interface/etc but this is really just a proof of concept.
if exists("loaded_nerdtree_ft_flags_plugin")
finish
endif
let g:loaded_nerdtree_ft_flags_plugin = 1
View coffee_filter.vim
"chuck this in ~/.vim/nerdtree_plugin/coffee_filter.vim (see what I did there?)
if exists("g:loaded_nerdtree_js_filter")
finish
endif
let g:loaded_nerdtree_js_filter = 1
let s:extMatch = '\.\(js\|js\.map\)$'
call g:NERDTree.AddPathFilter("FilterCoffee")
View override_tab_mapping.vim
call NERDTreeAddKeyMap({'key': 't', 'callback': 'NERDTreeMyOpenInTab', 'scope': 'FileNode', 'override': 1 })
function NERDTreeMyOpenInTab(node)
call a:node.open({'reuse': "all", 'where': 't'})
endfunction
View vimrc
fu! NERDTreeFindPrevBuf()
if g:NERDTree.IsOpen()
NERDTreeClose
elseif (!filereadable(bufname('%')) || (bufname('%') == '__Tag_List__') || (bufname('%') == '__Tagbar__'))
echo "Previous buf not valid or readable file."
NERDTree
else
NERDTreeFind
endif
You can’t perform that action at this time.