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 pluralRu = function pluralRu(value) { | |
| if (arguments.length != 4) throw "Wrong number of arguments" | |
| var number = Math.abs(value), | |
| one = arguments[1] || '', two = arguments[2] || '', five = arguments[3] || ''; | |
| number %= 100; | |
| if (number >= 5 && number <= 20) return five; | |
| number %= 10; | |
| if (number == 1) return one; | |
| if (number >= 2 && number <= 4) return two; |
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
| Date.prototype.leap = function(){ | |
| var year = this.getFullYear(); | |
| return (!(year % 4) && (year % 100) || !(year % 400)); | |
| }; |
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({ | |
| inGroupsOf: function(array, number, fillWith) { | |
| fillWith = fillWith || null; | |
| var index = -number, slices = []; | |
| if (number < 1) return array; | |
| while ((index += number) < array.length) { | |
| var s = array.slice(index, index + number); | |
| while(s.length < number) |
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
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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
| /* simple */ | |
| var extends = function(child, parent) { | |
| var F = function() { } | |
| F.prototype = parent.prototype | |
| child.prototype = new F() | |
| child.prototype.constructor = child | |
| child.superclass = parent.prototype | |
| } | |
| /* from CoffeeScript */ |
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 shiftDate = function(date, what, count) { | |
| var proc1 = 'get' + what, | |
| proc2 = 'set' + what; | |
| var value = Date.prototype[proc1].call(date); | |
| Date.prototype[proc2].call(date, value + count); | |
| return date; | |
| } | |
| console.log(shiftDate(new Date, 'Date', -21)); |
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
| oneTimePer = (ms, func) -> | |
| ms or (ms = 1000) | |
| -> | |
| self = arguments.callee | |
| self._lastTimeCalled = new Date unless self.hasOwnProperty("_lastTimeCalled") | |
| if new Date - self._lastTimeCalled > ms | |
| self._lastTimeCalled = new Date | |
| func.apply this, arguments | |
| myFunc = oneTimePer 2000, (x, y) -> x + y |
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
| $page_width: 850px; | |
| @function grid_width($width, $margin, $columns) { | |
| @return ($width - ($margin * ($columns - 1))) / $columns; | |
| } | |
| @mixin grid-column($columns, $prefix, $sufix, $gutter, $border_right, $border_left, $cw, $cm) { | |
| $width: (($cw + $cm) * $columns) - $cm; | |
| $prefix_width: ($cw + $cm) * $prefix; | |
| $sufix_width: ($cw + $cm) * $sufix; |
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 bash | |
| set -e | |
| SETTINGS=$2 | |
| DB_USER="dbuser" | |
| DB_NAME="dbname" | |
| DB_PASS="dbpass" | |
| DB_HOST=localhost |
OlderNewer