Skip to content

Instantly share code, notes, and snippets.

View sjelfull's full-sized avatar

Fred Carlsen sjelfull

View GitHub Profile
@joshuat
joshuat / Slack avatar-less sidebar.md
Last active January 19, 2021 08:25
Remove the avatars from your slack sidebar

Slack has listened to feedback and given us a way to toggle off the sidebar avatars.

(This only seems to be available in the Beta channel at the moment)

Display or hide profile photos

  1. From your desktop, click your profile picture in the top right.
  2. Select Preferences from the menu.
  3. Click Sidebar in the left-side column.
  4. Check or uncheck the boxes next to Show profile photos next to DMs.
@wesbos
wesbos / download-shows.ts
Created November 11, 2020 02:07
deno syntax episode downloader
// deno run --allow-net --allow-write download-shows.ts
import { download } from "https://deno.land/x/download/mod.ts";
const showList = 'https://syntax.fm/api/shows';
async function getShowList(): Promise<Show[]> {
const list = await (await fetch(showList)).json();
return list;
}
@poacher2k
poacher2k / Wishy.gift CloudFlare firewall rule
Last active October 30, 2020 11:23
Based on automated requests from attackers, this rule has stopped ~99% of all bad traffic. Add new rule -> "Edit expression" -> Paste -> "Use expression builder" -> Customize
(http.request.uri.path contains ".php") or (http.request.uri.path contains ".env") or (http.request.uri.path eq "/blog/") or (http.request.uri.path contains "wordpress") or (http.request.uri.path eq "/wp/") or (http.request.uri.path eq "/new/") or (http.request.uri.path eq "/old/") or (http.request.uri.path eq "/test/") or (http.request.uri.path eq "/main/") or (http.request.uri.path eq "/site/") or (http.request.uri.path eq "/backup/") or (http.request.uri.path eq "/home/") or (http.request.uri.path eq "/cms/") or (http.request.uri.path eq "/tmp/") or (http.request.uri.path eq "/dev/") or (http.request.uri.path eq "/old-wp/") or (http.request.uri.path eq "/web/") or (http.request.uri.path eq "/old-site/") or (http.request.uri.path eq "/temp/") or (http.request.uri.path eq "/2018/") or (http.request.uri.path eq "/2019/") or (http.request.uri.path eq "/bk/") or (http.request.uri.path eq "/wp1/") or (http.request.uri.path eq "/wp2/") or (http.request.uri.path eq "/v1/") or (http.request.uri.path eq "/v2/") or (
@gatsbyjs-employees
gatsbyjs-employees / Open letter to the Gatsby community.md
Last active February 23, 2021 00:24
Open letter to the Gatsby community

To the Gatsby Community,

We want to start by specifically thanking Nat Alison. We support her and commend her bravery in speaking out. It is not easy to stand alone. What she experienced at Gatsby was unacceptable and speaks to wider issues. We thank her for putting pressure on the company to fix them. We vow to double down on those efforts.

While we have worked hard to give feedback and help create a healthy work environment over the past few years, change has been far too slow and the consequences have been real. The previous weeks have intensified the need for rapid change by increasing employee communication and allowing us to collectively connect some dots. We are just as outraged. As a result, we have posed a series of hard questions to management as well as a list of concrete actions they need to take.

Kyle Mathews' public apologies to both Nat Alison and Kim Crayton are small actions swiftly taken that signal the possibility for change but don't speak to the systemic issues that must be addressed.

@steveruizok
steveruizok / getSegmentCubicBezierIntersections.ts
Last active May 13, 2022 06:32
Get the point(s) at which a line segment intersects a cubic bezier curve.
// Adapted from https://github.com/w8r/bezier-intersect
/**
* Get the point(s) at which a line segment intersects a cubic bezier curve.
* @param p0x The x-coordinate of the curve's starting point.
* @param p0y The y-coordinate of the curve's starting point.
* @param p1x The x-coordinate of the curve's first control point.
* @param p1y The y-coordinate of the curve's first control point.
* @param p2x The x-coordinate of the curve's second control point.
* @param p2y The y-coordinate of the curve's second control point.
@reinink
reinink / query.sql
Last active November 14, 2023 11:08
Text search across multiple tables using MySQL
select
first_name,
last_name
from
users
left join
companies on companies.id = users.company_id
where (
companies.name like 'TERM%' or
first_name like 'TERM%' or

Add Authentication with Auth0 to a Gatsby site

All the pieces of authentication are possible in Gatsby. Thanks to Auth0, setting it up doesn't have to be so cumbersome!

This setup comes straight from Auth0's official quick start for React.


The first step is installing the official Auth0 SDK for JavaScript from npm.

@Mosnar
Mosnar / staging.yml
Last active April 8, 2020 15:44
Craft CMS & Webpack on Laravel Forge
name: Deploy to Staging
on:
push:
branches: [ develop ]
jobs:
build:
runs-on: ubuntu-latest
steps:
@donmccurdy
donmccurdy / THREE_COLORSPACE_MANAGEMENT.md
Last active January 2, 2023 08:07
Color management in three.js
@mattdesl
mattdesl / about.md
Last active December 15, 2023 17:45
png + svg export with canvas-sketch and context 2D

PNG + SVG export from canvas-sketch

The helper function canvas-to-svg.js wraps a given render function (or renderer object) so that you can use Canvas2D context methods as usual, but upon single frame export (with Cmd/Ctrl + S) it will produce both a PNG and SVG file.

This uses canvas2svg which is not a perfect solution, as the Canvas2D API was never designed to be translated to SVG. Its best to stick with simple shape and path operations.

Full instructions: first install the canvas-sketch CLI if you haven't already:

npm install canvas-sketch-cli -g