This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ActiveRecord | |
1) | |
В фрагменте кода показано два класса: Listing и Category | |
У Listing есть много Category ( в обратку должно быть belongs_to - но тут вроде как не обязательно) | |
Listing содержит поля "published", "name" ( не очень понял зачем поле name ) | |
Category содержит поля "top_rated", "title" и должно содержать "listing_id" ( но можно и без него ) | |
Метод класса "categories": | |
1. создает два пустых массива ( с их помощью, в дальнейшем, делается сортировка по полю top_rated ) | |
2. выбирает все обьекты Listing ( все строки из таблици Listing ), у которых поле 'published' равно |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#console-messages .console-group-messages .section .header::before, | |
#console-messages .properties-tree li.parent::before | |
{ | |
content: url(chrome-devtools://devtools/Images/treeRightTriangleWhite.png) !important; | |
} | |
#console-messages .console-group-messages .section.expanded .header::before, | |
#console-messages .properties-tree li.parent.expanded::before | |
{ | |
content: url(chrome-devtools://devtools/Images/treeDownTriangleWhite.png) !important; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Model | |
@user.should have(1).error_on(:username) # Checks whether there is an error in username | |
@user.errors[:username].should include("can't be blank") # check for the error message | |
#Rendering | |
response.should render_template(:index) | |
#Redirecting | |
response.should redirect_to(movies_path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Model | |
@user.should have(1).error_on(:username) # Checks whether there is an error in username | |
@user.errors[:username].should include("can't be blank") # check for the error message | |
#Rendering | |
response.should render_template(:index) | |
#Redirecting | |
response.should redirect_to(movies_path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
current_branch = `git symbolic-ref --short HEAD`.to_s.strip! | |
first_preproduction_sha = `git merge-base #{current_branch} preproduction` | |
first_master_sha = `git merge-base #{current_branch} master` | |
preproduction_timestamp = `git show -s --format=%ci #{first_preproduction_sha}` | |
master_timestamp = `git show -s --format=%ci #{first_master_sha}` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "keys": ["f9"], "command": "reindent"}, | |
{ "keys": ["alt+down"], "command": "paste_from_history" }, | |
{ "keys": ["shift+ctrl+g"], "command": "grep_file" }, | |
{ "keys": ["super+'"], "command": "change_quotes" }, | |
{ "keys": ["shift+super+r"], "command": "reveal_in_side_bar" } | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin | |
import os, re | |
def is_folder(path, action): | |
regex = re.compile(action) | |
return regex.findall(path) | |
def generate_prefix(path, folder_name): | |
if folder_name == 'controller': | |
return path.rstrip('_controller.rb').split('/controllers/')[1] + '/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[ | |
<%= ${1} %> | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>z</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
<!-- <scope>source.python</scope> --> | |
</snippet> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source ~/.profile | |
source ~/.git-libs/git-completion.bash | |
source ~/.git-libs/git-prompt.sh | |
export PATH=/usr/local/bin:$PATH | |
export EDITOR='subl -w' | |
alias ns='cd ~/Dropbox/ror/anadea/nowshop' | |
alias jw='cd ~/Dropbox/ror/junior_way' | |
alias cl='cd ~/Dropbox/ror/anadea/clique' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module("Meek").controller "RadioStationsController", ( | |
$sce | |
$rootScope | |
$scope | |
$stateParams | |
Category | |
RadioStation | |
ApplicationService | |
RankService | |
) -> |
OlderNewer