Skip to content

Instantly share code, notes, and snippets.

View AndrewRadev's full-sized avatar

Andrew Radev AndrewRadev

View GitHub Profile
@AndrewRadev
AndrewRadev / README.markdown
Created August 11, 2011 16:45 — forked from skanev/README.markdown
Convert a <select> with <optgroups> to two <select>s that are interconnected

If you have a select with option groups:

<select data-nested-select="Select country">
  <option>Select city</option>
  <optgroup label="Bulgaria">
    <option value="sofia">Sofia</option>
    <option value="plovdiv">Plovdiv</option>
  </optgroup>
  <optgroup label="Sweden">

Stockholm

@AndrewRadev
AndrewRadev / Coffeescript ctags
Created February 28, 2012 13:51 — forked from wereHamster/Coffeescript ctags
ctags definitions for coffeescript
# Detects classes, static/class methods, plain functions and variables.
# To use, place it in a ~/.ctags file.
--langdef=coffee
--langmap=coffee:.coffee
--regex-coffee=/(^|=[ \t])*class ([A-Za-z.]+)( extends [A-Za-z.]+)?$/\2/c,class/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?@?([A-Za-z.]+):.*[-=]>.*$/\3/f,function/
--regex-coffee=/^[ \t]*(module\.)?(exports\.)?([A-Za-z.]+)[ \t]+=.*[-=]>.*$/\3/f,function/
--regex-coffee=/^[ \t]*([A-Za-z.]+)[ \t]+=[^->\n]*$/\1/v,variable/

Working effectively with ctags has always been a topic I missed for a long time because I was too lazy to invest time to learn about the it.

I was working on on my application and was constantly consulting Padrino's API doc in the browser. It would have been more effective if I can do the searching directly the Padrino's code on GitHub. Benefit I don't have to leave the terminal and can focus on my task.

What is ctags

ctags is a tool which make it easy for you to shift through in no time.

@AndrewRadev
AndrewRadev / bundle_updater_for_vim
Created July 21, 2011 09:28 — forked from vladimiroff/bundle_updater_for_vim
Handy shell script for keeping my bundles in vim up-to date
cd $HOME/.vim/bundle/
for plugin in *; do
cd $plugin
echo ":: Updating $plugin ..."
if [ -d .git ]; then
git checkout master
git pull origin master
else
echo ":: $plugin is not managed as a submodule"
fi