Skip to content

Instantly share code, notes, and snippets.

View vushe's full-sized avatar
💾

Valentin Dzhankhotov vushe

💾
View GitHub Profile
@johndyer
johndyer / easter.js
Last active April 9, 2024 16:28
Calculate Easter in JavaScript
/**
* Calculates Easter in the Gregorian/Western (Catholic and Protestant) calendar
* based on the algorithm by Oudin (1940) from http://www.tondering.dk/claus/cal/easter.php
* @returns {array} [int month, int day]
*/
function getEaster(year) {
var f = Math.floor,
// Golden Number - 1
G = year % 19,
C = f(year / 100),
@danielpchen
danielpchen / sass-explode.scss
Created February 19, 2016 05:18
Sass explode()
// @function explode() -- split a string into a list of strings
// {string} $string: the string to be split
// {string} $delimiter: the boundary string
// @return {list} the result list
@function explode($string, $delimiter) {
$result: ();
@if $delimiter == "" {
@for $i from 1 through str-length($string) {
$result: append($result, str-slice($string, $i, $i));
}