Skip to content

Instantly share code, notes, and snippets.

@hdragomir
hdragomir / sm-annotated.html
Last active October 9, 2024 00:35
The deferred font loading logic for Smashing Magazine. http://www.smashingmagazine.com/
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
@arturkot
arturkot / .vimrc
Created August 8, 2019 08:32
Vim settings
set number
set autoread
set tabstop=2
runtime macros/matchit.vim
" Ignores
set wildignore+=*/tmp/*,*/node_modules/*,*/dist/*,*.so,*.swp,*.zip
" Prettier
function RunPrettier()

isEven = (n) => n == 1 ? false : n == 2 ? true : isEven(n-2); Take recursion in control.

What is a recursion? Why and when use a recursion? How to write recursive function easily? Take this in control!

What is a recursion?

Recursion is when type is defined by itself.
OK, let's proceed to another topi-... What, what do I hear? Not extensive enough? Right!

# Git-branches
function git-branches() {
if [ ! -z $1 ]
then
author=$1
else
author="Artur"
fi
git for-each-ref --format=' %(authorname) %09 %(refname)' --sort=authorname | grep ${author} | grep -v 'origin/release-'