Skip to content

Instantly share code, notes, and snippets.

View vushe's full-sized avatar
💾

Valentin Dzhankhotov vushe

💾
View GitHub Profile
@vushe
vushe / sass-explode.scss
Created March 12, 2019 12:41 — forked from danielpchen/sass-explode.scss
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));
}
@vushe
vushe / countdown.sh
Created September 20, 2018 17:10 — forked from krohne/countdown.sh
Countdown timer in bash shell script
#!/bin/bash
# $1 = # of seconds
# $@ = What to print after "Waiting n seconds"
countdown() {
secs=$1
shift
msg=$@
while [ $secs -gt 0 ]
do
printf "\r\033[KWaiting %.d seconds $msg" $((secs--))
@vushe
vushe / easter.js
Created April 17, 2018 10:49 — forked from johndyer/easter.js
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),