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
module PaginateHelper | |
class LinkRenderer < WillPaginate::ActionView::LinkRenderer | |
protected | |
def html_container(html) | |
tag(:nav, tag(:ul, html, class: "pagination")) | |
end | |
def previous_or_next_page(page, text, classname) | |
if page |
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
var xSelector = () => 11; | |
var ySelector = () => 22; | |
var zSelector = () => ({ z1: 31, z2: 32 }); | |
var mainSelector = createSelector( | |
xSelector, ySelector, zSelector, | |
(...all) => { | |
let [x, y, { z1, z2 }] = all; | |
return { | |
x, |
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
@mixin multiline-ellipsis( | |
$lines, | |
$lineHeight: 1.4, | |
$ellipsisWidth: 3em, | |
$bgColor: white | |
) { | |
box-sizing: content-box; | |
overflow: hidden; | |
height: $lines * $lineHeight * 1em; | |
line-height: $lineHeight; |
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 node | |
/* | |
Usage in shell: | |
hashfile [--sha1|--md5] <file> [--eq <hash2>|--eqf <file2>] | |
Examples: | |
> hashfile package.json => print sha1 hash of package.json |
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
function Rect(width, height) { | |
this.width = width; | |
this.height = height; | |
} | |
Rect.prototype.type = function() { return "rect"; }; | |
function Square(width) { | |
return new Rect(width, width); | |
} | |
Square.prototype.type = function() { return "square"; }; |
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
var rc = new Rect(); | |
var sq = new Square(); | |
console.log(rc instanceof Rect); //=> true | |
console.log(sq instanceof Square); //=> true | |
console.log(sq instanceof Rect); //=> true !!! |
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
function Rect(color, width, height) { | |
// определяем геттеры | |
this.color = function() { | |
return color; | |
}; | |
this.width = function() { | |
return width; | |
}; | |
this.height = function() { | |
return height; |
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
function Rect(colot, width, height) { | |
// задаём поля, в будущем можем их изменить напрямую | |
this.color = color; | |
this.width = width; | |
this.height = height; | |
} | |
// [1.1] расширяем прототип: | |
// то же самое получим вызовом jQuery.extend(Rect.prototype, { ... }); | |
Rect.prototype.s = function() { |