Skip to content

Instantly share code, notes, and snippets.

tplink archer t4u driver
https://askubuntu.com/questions/802205/how-to-install-tp-link-archer-t4u-driver
@faustienf
faustienf / media.scss
Created April 11, 2018 10:15
Simple breakpoint mixin
// breakpoints from bootstrap 4
$grid-breakpoints: (
xs: 0,
sm: 576px,
md: 768px,
lg: 992px,
xl: 1200px
) !default;
@mixin breakpoint($point) {
@faustienf
faustienf / sort.js
Created February 10, 2018 10:55
sort anime on http://animeru.tv
$('#mse2_results .mse2-row').sort(function(a,b) {
function getViews(el) {
return Number($(el).find('table tr:last td').text().trim().match(/\d+$/ig)[0])
}
return getViews(b) - getViews(a);
}).appendTo('#mse2_results');
@faustienf
faustienf / getCalendarMatrix.js
Last active December 29, 2017 22:18
Generate matrix for calendar
/**
* Dependencies
* moment
* ramda
*/
/**
*
* @param {string} date
* @param {Object} options
@faustienf
faustienf / declination.js
Created December 19, 2017 13:24
Склонятор
export function declination(num, titles) {
const cases = [2, 0, 1, 1, 1, 2];
return titles[(num % 100 > 4 && num % 100 < 20)
? 2
: cases[(num % 10 < 5) ? num % 10 : 5]
];
}
declination(1, ['яблоко', 'яблока', 'яблок']); // яблоко
declination(2, ['яблоко', 'яблока', 'яблок']); // яблока