Skip to content

Instantly share code, notes, and snippets.

View Yukaii's full-sized avatar
👾
nyan, nyan, nyan

Yukai Huang Yukaii

👾
nyan, nyan, nyan
View GitHub Profile
@gsuuon
gsuuon / colors.lua
Last active March 18, 2024 13:41
My styled wezterm config - just the relevant bits
local wezterm = require 'wezterm'
local color_default_fg_light = wezterm.color.parse("#cacaca") -- 💩
local color_default_fg_dark = wezterm.color.parse("#303030")
return {
VERIDIAN = {
bg = wezterm.color.parse("#4D8060"),
fg = color_default_fg_light
},
@asportnoy
asportnoy / q.fish
Last active May 9, 2023 20:02
GitHub Copilot CLI for Fish Shell
# Requires the GitHub Copilot CLI from GitHub Next
# https://www.npmjs.com/package/@githubnext/github-copilot-cli#installation-and-setup
# This needs to be set up as a function in your fish config. You can use `funced -s q` to do this.
# Options:
# q -g --git: Use github-copilot-cli git-assist
# q -h --gh: Use github-copilot-cli gh-assist
# Defaults to using what-the-shell (general command assist) if neither option is provided
# Completions for your Fish config:
@LintaoAmons
LintaoAmons / .tmux.conf
Created October 8, 2022 09:50
Popup terminal with tmux
# ... your other config
bind-key -n M-3 run-shell 'toggle-tmux-popup'
# you can switch `M-3` to any keybindings you like.
@Christopher-Hayes
Christopher-Hayes / slack-bolt.md
Last active February 16, 2024 18:37
Building a Serverless SlackBot with Bolt on Vercel - Things to Know

Some gotchas from my recent experience of building a serverless Next.JS + Bolt.JS Slack App on Vercel.

Note that if you're building an app that you want to distribute to other workspaces, AFAIK you need to build an API. So, Next.JS is used here to help with the public API. The alternative to an API is using "socket mode".

Slack API with Bolt must use /slack/events endpoint

  • When building out the API, Bolt ONLY uses the /slack/events endpoint. The Slack config settings will suggest you provide a different endpoint, like /slack/commands for Slash Commands. That would work if you weren't using the Node API (via Bolt), such as the Python API. However, Bolt uses the Node API which ONLY uses /slack/events for everything. You can still use Bolt functions app.command() and similar, just remember to put the /slack/events endpoint in the Slack config.

Serverless is not supported with Bolt

@frabert
frabert / COPYING
Last active December 21, 2023 13:35
Favicons for HN
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@farzaa
farzaa / dec2021.md
Last active October 25, 2023 16:53

Dec. 2021 Update

Hey everyone, it's been an insane last two months. Over 35,000 devs, $200,000 in booked revenue, and multiple web3 companies created + launched by buildspace alumni. Crazy to think 6 months ago we were building ZipSchool -- a product for kids K-5 (you can still use it if you want hehe).

TLDR: We've become to default place devs come to join web3 (ex. see herehere, here, and thousands of others here). We'll also be raising money. Focused mainly on raising from founders/ex-founders. If that sounds like you, pls DM me :).

Going to combine the November and December update here.

@sindresorhus
sindresorhus / esm-package.md
Last active May 1, 2024 07:18
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.

⚠️ Warning: this document is out of date.

For the most recent webpack5 instructions see MIGRATION.md.

Storybook experimental Webpack 5 support

Storybook 6.2 includes experimental Webpack 5 support. Webpack 5 brings a variety of performance improvements, as well as exciting new features like module federation. Here's a quick guide to get you going.

Intro

@jeb5
jeb5 / Youtube Subs to OPML.js
Last active April 16, 2024 18:30
Youtube Subscriptions to RSS/OPML
const channels = [...document.querySelectorAll("#main-link.channel-link")].map(e => {
const [, a, b] = e.href.match("/((?:user)|(?:channel))/(.*)$");
const feed = "https://www.youtube.com/feeds/videos.xml?" + (a === "user" ? "user=" : "channel_id=") + b;
const channelName = e.querySelector("yt-formatted-string.ytd-channel-name").innerText;
return [feed, channelName];
});
if (channels.length == 0) {
alert("Couldn't find any subscriptions");
} else {
console.log(channels.map(([feed, _]) => feed).join("\n"));