Skip to content

Instantly share code, notes, and snippets.

View beautyfree's full-sized avatar
😼

Alexey Elizarov beautyfree

😼
View GitHub Profile
@beautyfree
beautyfree / loop.js
Last active August 29, 2015 14:23 — forked from nosalvage/loop.js
angular.forEach(items, function(item, key) {
if(item.attachments){
angular.forEach(item.attachments, function(attachment, key) {
if(attachment.type == 'video') {
feed.getVideo(attachment.video.owner_id, attachment.video.owner_id+'_'+attachment.video.id).then(function(result){
videos[item.id].player = result.data.response.items[0].player;
});
}
}
}
@beautyfree
beautyfree / derji.js
Last active August 29, 2015 14:23 — forked from anonymous/derji
.factory('feed', function($http, vk, $localStorage){
var owner_id = '-34882023';
var version = '5.34';
var count = '5';
var items = [];
var liked;
var isLiked = function(itemId){
return vk.call('likes.isLiked', {item_id: itemId, owner_id: owner_id, access_token: $localStorage.token, type: 'post', v: version}).then(function(result){
return result;
}, function(err){console.log('err' + err)});

Angular Logo

Обзор

Angular.js, JavaScript Framework, на котором теперь ведется вся разработка в компании CloudMill. В этом обзоре будут приведены основные ссылки на изучение, так же он будет постоянно пополняться необходимыми сниппетами и правилами оформления.

Инфраструктура

Мы работаем с проектом Yeoman, он создает базовую структуру, настраивает тесты и grunt для минификации кода для продакшена, так же дает live-reload и много других полезностей.

#CSS & HTML Development Spec#

##Браузеры## Если не оговорено отдельно, то считать эти версии минимально поддерживаемыми. Никакой поддержки IE6 и IE7, даже бесплатно делать не нужно и запрещается! Под Graceful Degardation подразумевается частичный отказ функционала, скругленные углы, тени, анимация. Главное что бы верстка не разваливалась. Если вы знаете браузер, которого нет в этом списке его поддержка не нужна и запрещена.

Вся верстка должна быть mobile ready. Это значит, что сайт должен правильно отображаться на мобильных устройствах (список ниже). Элементы не должны ехать, зум должен работать, при перевороте устройств, все должно правильно репозиционироваться. В случае если не используется responsive design.

####Graceful Degradation####

  • IE9
@beautyfree
beautyfree / user.rb
Created January 2, 2014 11:35 — forked from Olefine/user.rb
# encoding: utf-8
class User < ActiveRecord::Base
attr_accessor :read # user's agreement
scope :unbanned, where(:banned => false)
scope :last_users, ->(count) { order("id DESC").limit(count) }
include Models::User::City
include Models::User::MessageStuff
@beautyfree
beautyfree / user.rb
Created January 2, 2014 11:34 — forked from kirs/user.rb
class User < ActiveRecord::Base
#default_scope where(:banned => false)
scope :unbanned, where(:banned => false)
include ChooseCity
rolify
acts_as_voter
has_karma(:questions, :as => :submitter, :weight => 0.5)
mount_uploader :avatar, AvatarUploader
@beautyfree
beautyfree / css_resources.md
Created December 18, 2013 14:54 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@beautyfree
beautyfree / rails_resources.md
Created December 18, 2013 14:54 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
  • rabl - General ruby templating with json, bson, xml, plist and msgpack support
  • Thin - Very fast and lightweight Ruby web server
  • Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
  • SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
  • Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
  • [factory_girl](h