Skip to content

Instantly share code, notes, and snippets.

View wyeo's full-sized avatar
👋

Williams YEO wyeo

👋
View GitHub Profile
export const intersperse = <T>(arr: T[], separator: (n: number) => T): T[] =>
arr.flatMap(arr, (a, i) => i > 0 ? [separator(i-1), a] : [a]))
@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing
@ryanve
ryanve / breakpoint.js
Last active June 9, 2024 21:49
JavaScript: Get the current media query breakpoint for a CSS feature.
(function(root, name, make) {
if (typeof module != 'undefined' && module['exports']) module['exports'] = make();
else root[name] = make();
}(this, 'breakpoint', function() {
/**
* @link http://gist.github.com/ryanve/7924792
* @param {string} feature range feature name e.g. "width"
* @param {string=} unit CSS unit for feature e.g. "em"
* @param {number=} init initial guess
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active November 2, 2024 08:30
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName