Skip to content

Instantly share code, notes, and snippets.

View nekitk's full-sized avatar

Nikita Golubov nekitk

View GitHub Profile
@zspecza
zspecza / stylus-best-practices.md
Last active May 27, 2021 05:25
Stylus Best Practices

Stylus Best Practices

Introduction

This is a curated set of conventions and best practices for Stylus, an expressive, dynamic, robust and advanced CSS preprocessor. Frustrated with there not being a set of conventions set in place (that could be easily found), I set forth to find out on my own.

@felixexter
felixexter / slack-delete-files.js
Last active October 18, 2017 14:35
slack-delete-files.js
function deleteFiles(types = 'all') {
let files = [];
function deleteFilesByTypes(types, page = 1) {
TS.api.call('files.list', {
types,
user: boot_data.user_id,
page
}, (a, data) => {
files = [...files, ...data.files];
@karol-majewski
karol-majewski / homogeneous-array.ts
Created September 22, 2019 22:13
Homogeneous arrays in TypeScript (+ check if a type is a union)
type Singleton = string;
type Union = string | number;
type DistributedKeyOf<T> =
T extends any
? keyof T
: never;
type DistributedValueOf<T> = T[DistributedKeyOf<T>];