Skip to content

Instantly share code, notes, and snippets.

View g-ilham's full-sized avatar

g-Ilham g-ilham

  • Russian, Republic of Tatarstan, Kazan
View GitHub Profile
@g-ilham
g-ilham / 3d cube.markdown
Last active September 3, 2015 12:52
3D cube.markdown

view:

h3 Мои Альбомы
br
.col-xs-6.col-md-3.cubes_list-cube id=dom_id(cubes_test.first)
  #cube_container
    - cubes_test.each do |cube|
      #cube.animate
        - if cube.cover.present? && cube.cover.cover_image.present?
          - ([cube.cover.cover_image] * 6).each_with_index do |image, index|
@g-ilham
g-ilham / grep in logs on VPS
Created August 27, 2015 10:11
grep in logs on VPS
A - after
B - before
C - same number of lines before and after
git blame Gemfile | grep -B10 -A10 BlaBla
git blame Gemfile | grep -C10 BlaBla
cat mylog | grep -A10 BlaBla
@g-ilham
g-ilham / git reset comands
Created May 27, 2015 14:52
git reset comands
http://tonyganch.com/git/reset/
git reset: повернуть время вспять
Самые страшные команды в гите: git reset --hard и git push --force.
Особенно если выполнены случайно, друг за другом и в репозитории, с которым работает ещё пара десятков человек.
Как быстро исправить ситуацию?
Сделать git reset.
Волшебная формула
@g-ilham
g-ilham / gist:8fbefd9f3b13e77d84f5
Last active August 29, 2015 14:21
Crontabs comands
crontab -l - просмотр комманд крона
crontab -r - удалить все комманды крона
crontab -e - редактировать команды крона
Для каждого пользователя свой!
0 4 * * * /sbin/shutdown -r +5
at the bottom. Explanation:
m h dom mon dow command
minute hour dayOfMonth Month dayOfWeek commandToRun
http://www.jqueryrain.com/?S4PWDcPG - Прилипает нет нормального API для нашей интеграции(не возможно выставить ширину высоту, лимитировать по зуму или убрать зум).
http://www.jqueryrain.com/?3Ht2BXj7 - Позволяет двигаться лишь влево вправо либо верх вниз и уменьшает фотографию.
http://codecanyon.net/item/image-crop/full_screen_preview/5348464?ref=jqueryrain - платный, адаптируется под размер фотографии. Уменьшает фотографии и двигается лишь вправо влево(без зума). Нельзя убрать зум или выставить ограничение.
http://cssdeck.com/labs/xnmcokhc - нету нормального API для нашей интеграции(лимит на зум и жутко тормозит)
http://www.jqueryrain.com/?BEAlLLl9 - двигается лишь верх вниз без зума, нет ограничения зума

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install:

@g-ilham
g-ilham / Install driver for TP-LINK:TL-WN727N
Created February 21, 2015 13:24
Install driver for TP-LINK:TL-WN727N
@g-ilham
g-ilham / index.md
Last active August 29, 2015 14:15 — forked from rstacruz/index.md

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

@g-ilham
g-ilham / js find with regexp
Created February 17, 2015 16:55
Jquery find object with regexp
jQuery(".post a[href$='tumblr.com']")
$ - end
^ - start
@g-ilham
g-ilham / sublime open in console
Created December 17, 2014 10:57
sublime open in console
subl --help Sublime Text 2 Build 2217
Usage: subl [arguments] [files] edit the given files
or: subl [arguments] [directories] open the given directories
or: subl [arguments] - edit stdin
Arguments:
--project <project>: Load the given project
--command <command>: Run the given command
-n or --new-window: Open a new window