Skip to content

Instantly share code, notes, and snippets.

View borisd's full-sized avatar

Boris Dinkevich borisd

View GitHub Profile
@borisd
borisd / gist:8693327
Created January 29, 2014 17:57
Cats table.html
<ul class="media-grid">
<% @cats.each do |cat| %>
<li class='thumbnail'>
<%= link_to cat_path(cat) do %>
<%= image_tag cat.image.url, alt: cat.name %>
<% end %>
<ul class="controls">
<% if can_like?(cat) %><li><%= link_to 'Like', like_cat_path(cat), method: :post, :class => 'btn btn-mini' %></li><% end %>
<% if can_unlike?(cat) %><li><%= link_to 'UnLike', unlike_cat_path(cat), method: :post, :class => 'btn btn-mini' %></li><% end %>
<% if can_edit?(cat) %><li><%= link_to 'Edit', edit_cat_path(cat), :class => 'btn btn-mini' %></li><% end %>
@borisd
borisd / gist:8693335
Created January 29, 2014 17:57
app/assets/stylesheets/application.css
.media-grid {
width: 100%;
}
.media-grid > li {
float: left;
display: block;
margin-right: 20px;
margin-bottom: 20px;
@borisd
borisd / gist:8693475
Last active August 29, 2015 13:55
Homework

Images

  • Add image to User

Gui

  • Add a link to the sidebar to "Favorite cats"
  • Add like / unlike to cat's show page
  • Show like counter for each cat
  • Add 'mini-feed' to user's show page with first 3 cats and link to more
@borisd
borisd / gist:8729510
Created January 31, 2014 10:12
Checkout new repository

Checkout

cd to the folder where you keep your projects

git clone git@bitbucket.org:bardelas/catz.git [folder_name]
cd [folder_name]
bundle update
rake db:migrate

rails s

# The amazing coffee
foo = (a,b) ->
a * b
This file has been truncated, but you can view the full file.
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
This file has been truncated, but you can view the full file.
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
@borisd
borisd / gist:3274046
Created August 6, 2012 12:23 — forked from dpaluy/gist:3273630
Heroku SHARED DATABASE migration to PostgreSQL
if [ $# -eq 0 ] ; then
echo "No args given"
echo "Missing Heroku app name"
exit 1
fi
APP_NAME="--app ${1}"
echo "heroku addons:add heroku-postgresql:dev ${APP_NAME}"
heroku addons:add heroku-postgresql:dev ${APP_NAME}
@borisd
borisd / API.md
Last active November 1, 2015 19:54
APIs for Redux 101 Workshop - by 500Tech.com
@borisd
borisd / gist:4390341
Last active December 10, 2015 05:48
ZSH
===============
- Typo correction:
crl google.com
- Really smart completion
kill [tab]
ls - [tab S]
- History accross sessions