Skip to content

Instantly share code, notes, and snippets.

@jenkek
jenkek / gist:3401432
Created August 20, 2012 05:53
remove installed gems
$ gem list | awk '{print $1}' | xargs gem uninstall -aIx
@jenkek
jenkek / gist:4083435
Last active October 12, 2015 20:29
rails console: disable sql logger
1.9.3p327 :027 > ActiveRecord::Base.logger = Logger.new('/dev/null')
@jenkek
jenkek / gist:4232265
Created December 7, 2012 10:06
vimrc
source ~/.vim/vimrc
imap <Ins> <Esc>i
autocmd BufWritePre * :%s/\s\+$//e
"Bubble single lines
nmap <C-Up> ddkP
nmap <C-Down> ddp
@jenkek
jenkek / gist:7002925
Created October 16, 2013 05:13
rails: disable sql & sunspot logger in console
1.9.1 :001 > ActiveRecord::Base.logger.level = 4
1.9.1 :002 > Sunspot::Rails::LogSubscriber.logger.level = 4
@jenkek
jenkek / gist:7559350
Created November 20, 2013 07:54
Downloading an Entire Web Site with wget
wget --recursive --convert-links --page-requisites --adjust-extension --continue --timestamping --no-parent --no-verbose http://site.ru
@jenkek
jenkek / gist:7781754
Created December 4, 2013 03:12
setup global bundle config
$ bundle config --global path ~/.bundle
$ bundle config --global bin bin
@jenkek
jenkek / gist:8553579
Last active May 7, 2018 18:21
How to: Delete a remote Git tag
# remove local tag
git tag -d tagname-123
# remove remote tag
git push origin :refs/tags/tagname-123
# delete multiple tags by patterns
for tag in $(git tag -l '[production|tusur]*'); do git tag -d $tag; git push origin :refs/tags/$tag; done
@jenkek
jenkek / gist:8804503
Last active November 2, 2018 02:39
calculate disk usage first level dirs on a volume
$ cd /
# ls -lrt | awk '/^d/ {print $9}'
for dir in `ls -d */`
do
# check those dir which are under /
CHECK_DIR=$(df $dir | awk '( $6 == "/" ) ')
# if dir under / then run du
[[ -z $CHECK_DIR ]] || du -sh $dir
done
@jenkek
jenkek / gist:8819194
Created February 5, 2014 08:15
override refinery:inquiries. gem refinerycms-inquiries (2.0.3)
rake refinery:override view=refinery/inquiries/admin/inquiries/*
rake refinery:override view=refinery/inquiries/admin/settings/*
rake refinery:override view=refinery/inquiries/inquiries/*
rake refinery:override view=refinery/inquiries/inquiry_mailer/*
rake refinery:override model=refinery/inquiries/*
rake refinery:override controller=refinery/inquiries/admin/*
rake refinery:override controller=refinery/inquiries/*
@jenkek
jenkek / gist:8858278
Last active September 7, 2017 15:42
meta tags for seo
<meta name="description" content="Большинство поисковых серверов отображают содержимое поля description при выводе результатов поиска. Если этого тега нет на странице, то поисковый движок просто перечислит первые встречающиеся слова на странице, которые, как правило, оказываются не очень-то и в тему." />
<meta name="Keywords" content="HTML, META, метатег, тег, поисковая система" />
<!-- The Open Graph protocol -->
<!-- description: http://ogp.me/#metadata -->
<meta property="og:title" content="The Rock" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/" />
<meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />
<!-- array: http://ogp.me/#array -->