Skip to content

Instantly share code, notes, and snippets.

@inchoate
inchoate / readme.md
Last active July 17, 2024 09:36
Open clicked URLs into a particular Google Chrome profile

Problem

When I click on links from Slack or Outlook on MacOS they open in seemingly random browser windows/profiles. This is annoying.

Solution

Open links in a particular google chrome profile window. Be less annoyed.

  1. In Chrome, visit chrome://version and find the desired profile name. Mine was Default. Copy that profile's directory name, like Profile 2 or Default, not the profile's vanity name you see when you click on your profile icon in the browser.
  2. Install Finicky: brew install finicky. After install it should be running and you should see the icon in the upper toolbar.
  3. From the Finicky Toolbar Item, click > Config > Create New
  4. Edit the new file ~/.finicky and make it look something like this, filling in your profile name:
@kentcdodds
kentcdodds / useOnRead.tsx
Last active June 9, 2021 04:24
How I determine whether you've read a blog post.
function useOnRead({
parentElRef,
onRead,
enabled = true,
}: {
parentElRef: React.RefObject<HTMLElement>
onRead: () => void
enabled: boolean
}) {
React.useEffect(() => {
@mcalthrop
mcalthrop / nvm-and-node-with-apple-m1-chip.md
Last active November 17, 2021 22:41
Using Node with Apple's new M1 chip

Using NVM and node with Apple's new M1 chip

20 January 2021

Rationale

At the time of writing, there are no pre-compiled NodeJS binaries for versions prior to 15.x for Apple's new M1 chip (arm64 architecture).

Additional issues encountered:

@DD5HT
DD5HT / .travis.yml
Last active July 13, 2018 20:01
Using Travis CI to create publish multi target code.
os:
- linux
language: rust
rust:
- nightly
cache:
- apt
matrix:
include:
- env:
@jaredpalmer
jaredpalmer / App.js
Created May 30, 2017 17:45
Next.js-like SSR without Next.js.
import React from 'react';
import Route from 'react-router-dom/Route';
import Link from 'react-router-dom/Link';
import Switch from 'react-router-dom/Switch';
const App = ({ routes, initialData }) => {
return routes
? <div>
<Switch>
{routes.map((route, index) => {
@xanecs
xanecs / _elementaryOS_on_C720.md
Last active July 12, 2021 17:02
elementaryOS Loki on Acer Chromebook C720

This guide will show you how to install and configure elementaryOS Loki on your Acer C720 or C720p. I'm assuming you have installed some sort of Linux on your Chromebook before and already know your way around in Developer Mode. If not, read and follow https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/acer-c720-chromebook sections "Developer Mode" and "Legacy Boot".

Installation

Nothing special here: Download the ISO from https://elementary.io (put in $0 as an amount to download the ISO for free, although you should consider donating)

@mschuwalow
mschuwalow / backup-github.sh
Last active May 31, 2024 23:23 — forked from rodw/backup-github.sh
A simple script to backup an organization's GitHub repositories, wikis and issues. Using full_name instead of name and dropping all org stuff.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
# NOTE: if you have more than 100 repositories, you'll need to step thru the list of repos
# returned by GitHub one page at a time, as described at https://gist.github.com/darktim/5582423
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"<backup-dir>"} # where to place the backup files
GHBU_UNAME=${GHBU_UNAME-"<username>"} # the username of a GitHub account (to use with the GitHub API)
GHBU_PASSWD=${GHBU_PASSWD-"<password>"} # the password for that account
#!/usr/bin/env bash
# https://code.google.com/p/chromium/issues/detail?id=226801
url='https://chromium.googlesource.com/chromium/src/net/+/master/http/transport_security_state_static.json?format=TEXT';
curl -#s "${url}" | \
base64 --decode | \
sed '/^ *\/\// d' | \
sed '/^\s*$/d' > hsts.json;
@clarkjones
clarkjones / HaxeScript.hx
Last active July 12, 2018 19:55 — forked from jasononeil/HaxeScript.hx
haxex, a short shell script that can be used so you have Haxe shell scripting
#!/usr/bin/env haxex -lib mcli @
/**
Taken from mcli example https://github.com/waneck/mcli
Say hello.
Example inspired by ruby's "executable" lib example
**/
class HaxeScript extends mcli.CommandLine
{
/**
@luckylooke
luckylooke / cellAutoVoronoi.js
Last active October 6, 2017 00:01
Rewriten library cellauto to make it work on diagrams generated by Raymond Hill voronoi library( https://github.com/gorhill/Javascript-Voronoi )
// rewriten from http://sanojian.github.io/cellauto/
function CellAutoVoronoiCell(index) {
this.index = index;
this.delays = [];
}
CellAutoVoronoiCell.prototype.process = function(neighbors) {
return;
};