Skip to content

Instantly share code, notes, and snippets.

View olton's full-sized avatar
🏠
Working from home

Serhii Pimenov olton

🏠
Working from home
View GitHub Profile
@IamSilviu
IamSilviu / Get week number
Last active January 24, 2022 08:40
JavaScript Get week number.
Date.prototype.getWeek = function () {
var onejan = new Date(this.getFullYear(), 0, 1);
return Math.ceil((((this - onejan) / 86400000) + onejan.getDay() + 1) / 7);
};
var myDate = new Date("2001-02-02");
myDate.getWeek(); //=> 5

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@gre
gre / easing.js
Last active June 27, 2024 15:37
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {