Skip to content

Instantly share code, notes, and snippets.

View tomquas's full-sized avatar

tom quas tomquas

  • patugo GmbH
  • munich, germany
View GitHub Profile
@tomquas
tomquas / readme.md
Created April 24, 2024 09:37 — forked from inchoate/readme.md
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:
@tomquas
tomquas / https-during-dev.macos.sh
Created March 22, 2022 09:33 — forked from disintegrator/https-during-dev.macos.sh
Use Caddy, mkcert and dnsmasq to expose your development server over HTTPS
brew install caddy mkcert nss dnsmasq
mkcert -install
mkcert '*.app.test' '*.cdn.test'
# rename the certs and move them under /usr/local/etc/caddy/certs
cat <<EOF > /usr/local/etc/caddy/Caddyfile
*.app.test:443, *.cdn.test:443 {
@tomquas
tomquas / days_since_epoch_bench.rb
Last active March 5, 2021 09:30
compares several ways to calculate the number of days passed since epoch
require 'date'
require 'benchmark/ips'
Benchmark.ips do |x|
# Configure the number of seconds used during
# the warmup phase (default 2) and calculation phase (default 5)
x.config(:time => 5, :warmup => 2)
# These parameters can also be configured this way
x.time = 5
@tomquas
tomquas / eu.topojson
Created February 20, 2020 21:39 — forked from milafrerichs/eu.topojson
Simple Map of Europe TopoJSON
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tomquas
tomquas / what-forces-layout.md
Created February 28, 2018 08:36 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@tomquas
tomquas / dnsmasq.conf
Created February 27, 2018 16:16 — forked from semistrict/dnsmasq.conf
dnsmasq.conf for VirtualBox on OSX
# Set this to the name of your VirtualBox host-only interface.
# dnsmasq will listen for DHCP and DNS requests on this interface as
# well as the loopback:
interface=vboxnet0
# This option will be forced anyway on OS X so set here to avoid a warning:
bind-interfaces
# Enable the integrated DHCP server, you need
# to supply the range of addresses available for lease and optionally
@tomquas
tomquas / promises.re
Created February 9, 2018 08:01 — forked from lilactown/promises.re
Notes on using JavaScript Promises in ReasonML/BuckleScript
/**
* Making promises
*/
let okPromise = Js.Promise.make((~resolve, ~reject as _) => [@bs] resolve("ok"));
/* Simpler promise creation for static values */
Js.Promise.resolve("easy");
Js.Promise.reject(Invalid_argument("too easy"));
/**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2016 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
#ifdef USE_TI_MEDIA
#import "MediaModule.h"
#import "TiUtils.h"
@tomquas
tomquas / nginx.conf
Created July 12, 2016 06:34 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@tomquas
tomquas / Makefile
Created July 3, 2016 13:01 — forked from notozeki/Makefile
An example Ruby extension written in Crystal
CRYSTAL = crystal
UNAME = "$(shell uname -ms)"
LIBRARY_PATH = $(shell brew --prefix crystal-lang)/embedded/lib
LIBS = -levent -lpcl -lpcre -lgc -lpthread
LDFLAGS = -Wl,-undefined,dynamic_lookup
TARGET = crystal_example_ext.bundle
$(TARGET): crystal_example_ext.o
$(CC) -bundle -L$(LIBRARY_PATH) -o $@ $^ $(LIBS) $(LDFLAGS)