Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View LinusBorg's full-sized avatar
I may be slow to respond.

Thorsten Lünborg LinusBorg

I may be slow to respond.
View GitHub Profile
@kamilogorek
kamilogorek / _screenshot.md
Last active April 9, 2024 21:18
Clutter-free VS Code Setup
image
@bashbunni
bashbunni / .zshrc
Created October 27, 2022 21:41
CLI Pomodoro for Mac
# I'll be doing another one for Linux, but this one will give you
# a pop up notification and sound alert (using the built-in sounds for macOS)
# Requires https://github.com/caarlos0/timer to be installed
# Mac setup for pomo
alias work="timer 60m && terminal-notifier -message 'Pomodoro'\
-title 'Work Timer is up! Take a Break 😊'\
-appIcon '~/Pictures/pumpkin.png'\
-sound Crystal"
@sindresorhus
sindresorhus / esm-package.md
Last active April 23, 2024 09:02
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@tatianamac
tatianamac / tatiana-mac-speaker-rider.md
Last active March 24, 2024 12:22
Tatiana Mac's Speaker Rider

Speaker Rider

by Tatiana Mac

Last updated 14 April 2021

What is a speaker rider?

As speaking comes with immense privilege, I have crafted a speaker rider to set expectations and boundaries around my engagement. I am grateful to all the conference organisers who have brilliantly hosted me. I would love to continue to exercise this privilege to speak at conferences, and use this privilege to make the landscape more accessible and beneficial to tech's most historically excluded and marginalised communities.

Considerations

😫 I provide a lot of explanations for those of you who never had to consider these things. Most thoughtful conferences I've attended check most of these boxes intrinsically, particularly when conference runners are experienced speakers. They get it.

@Akryum
Akryum / FileExplorer.vue
Last active November 25, 2019 18:29
Example of migration to Vue Function-based Component API
<script>
import { isValidMultiName } from '@/util/folders'
import FOLDER_CURRENT from '@/graphql/folder/folderCurrent.gql'
import FOLDERS_FAVORITE from '@/graphql/folder/foldersFavorite.gql'
import FOLDER_OPEN from '@/graphql/folder/folderOpen.gql'
import FOLDER_OPEN_PARENT from '@/graphql/folder/folderOpenParent.gql'
import FOLDER_SET_FAVORITE from '@/graphql/folder/folderSetFavorite.gql'
import PROJECT_CWD_RESET from '@/graphql/project/projectCwdReset.gql'
import FOLDER_CREATE from '@/graphql/folder/folderCreate.gql'
@yyx990803
yyx990803 / commits.vue
Last active May 13, 2022 16:43
Vue examples comparisons in 2.x and function-based APIs
<template>
<div id="demo">
<h1>Latest Vue.js Commits</h1>
<template v-for="branch in branches">
<input type="radio"
:id="branch"
:value="branch"
name="branch"
v-model="currentBranch">
<label :for="branch">{{ branch }}</label>
/* Helper buddy for removing async/await try/catch litter 🗑 */
function O_o(promise) {
return promise.then(data => {
if (data instanceof Error) return [data]
return [null, data]
}).catch(err => [err])
}
/* Look ma, no try/catch */
async function usageExample(params) {
@threepointone
threepointone / for-snook.md
Last active August 26, 2023 15:43
For Snook

https://twitter.com/snookca/status/1073299331262889984?s=21

‪“‬In what way is JS any more maintainable than CSS? How does writing CSS in JS make it any more maintainable?”

‪Happy to chat about this. There’s an obvious disclaimer that there’s a cost to css-in-js solutions, but that cost is paid specifically for the benefits it brings; as such it’s useful for some usecases, and not meant as a replacement for all workflows. ‬

‪(These conversations always get heated on twitter, so please believe that I’m here to converse, not to convince. In return, I promise to listen to you too and change my opinions; I’ve had mad respect for you for years and would consider your feedback a gift. Also, some of the stuff I’m writing might seem obvious to you; I’m not trying to tell you if all people of some of the details, but it might be useful to someone else who bumps into this who doesn’t have context)‬

So the big deal about css-in-js (cij) is selectors.

@getify
getify / 1.js
Last active May 2, 2022 16:10
creating hard-bound methods on classes
class Foo {
constructor(x) { this.foo = x; }
hello() { console.log(this.foo); }
}
class Bar extends Foo {
constructor(x) { super(x); this.bar = x * 100; }
world() { console.log(this.bar); }
}
@taurus227
taurus227 / !Git hooks for NPM projects
Last active July 26, 2022 20:49 — forked from betorobson/post-checkout
git hook to run `npm install` after git pull, merge, rebase or checkout if package.json was changed
# The name for this gist (starts with exclamation mark, because the name of the gist is the name of the first file in ASCIIbetical order)