Skip to content

Instantly share code, notes, and snippets.

View ChillyBwoy's full-sized avatar
🕶️
(ノ ˘_˘)ノ ζ|||ζ ζ|||ζ ζ|||ζ

Eugene Cheltsov ChillyBwoy

🕶️
(ノ ˘_˘)ノ ζ|||ζ ζ|||ζ ζ|||ζ
View GitHub Profile
@ChillyBwoy
ChillyBwoy / LICENSE.txt
Created May 31, 2011 00:43 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
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
@ChillyBwoy
ChillyBwoy / in_groups_of.js
Created May 31, 2011 00:39
inGroupsOf function from prototype.js implementation for underscore.js
_.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)
@ChillyBwoy
ChillyBwoy / cookie.js
Created May 26, 2011 00:35
Cookie functions for underscore.js
@ChillyBwoy
ChillyBwoy / gist:646974
Created October 26, 2010 14:16
Check for a leap year
Date.prototype.leap = function(){
var year = this.getFullYear();
return (!(year % 4) && (year % 100) || !(year % 400));
};
@ChillyBwoy
ChillyBwoy / plural.js
Created October 25, 2010 16:02
plural ru
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;