Skip to content

Instantly share code, notes, and snippets.

View tachekent's full-sized avatar

Dorian McFarland tachekent

  • Offworld AS
  • Bergen, Norway
View GitHub Profile
@tachekent
tachekent / obsidian-bookmarklet.js
Created January 9, 2023 14:38
Browser bookmarklet to quickly capture selected text and URL into a new timestamped note in Obsidian.Requires Advanced URI plugin
javascript:d=new Date();date=d.getFullYear()+'-'+String(d.getMonth()+1).padStart(2,'0')+'-'+String(d.getDate()).padStart(2,'0');time=d.getHours()+'-'+d.getMinutes()+'-'+d.getSeconds();v='Otherhead';f='Inbox/To Process/'+date+'--'+time;p=document.title;q=location.href;if(document.getSelection){s=document.getSelection();}else{s='';};t=`---\ntags: fleetingNotes\n---\n\n[[${date}]]\n# `+p+'\n'+s+'[^1]\n\n'+'[^1]: '+document.URL;void(open('obsidian://advanced-uri?vault='+encodeURIComponent(v)+'&filepath='+encodeURIComponent(f)+'&data='+encodeURIComponent(t)));
@tachekent
tachekent / local-ssl-certs.md
Last active May 10, 2019 15:07
Trusted .local SSL certs for testing in Chrome on OSX

For testing .local domains using SSL we can't use letsencrypt & certbot as explained here. (where did that link go)

Instead we need to create our own self-signed certificates and get the local machine to trust them. Chrome is extra strict and whinges about pretty much everything, and I couldn't get it to trust a self-signed wildcard CN cert. So here's what I did to get it working locally on OSX with a happy chrome:

First create an openssl.cnf file:

[req]
prompt = no
distinguished_name = req_distinguished_name
@tachekent
tachekent / Cloudformation-Route53.yaml
Last active March 5, 2019 11:39
General reminders and gotchas for creating Route53 templates
AWSTemplateFormatVersion: 2010-09-09
Description: General format for a hosted zone and record set
# Useful references:
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-reference-route53.html
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset.html
# https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-choosing-alias-non-alias.html
# https://docs.aws.amazon.com/Route53/latest/APIReference/API_ResourceRecordSet.html#Route53-Type-ResourceRecordSet-Type
# Create a static website with a custom domain
@tachekent
tachekent / regexp-vs-array-speed-comparison.js
Last active September 11, 2018 18:45
Test if a joined regexp is faster than a simple array lookup
// needs node >= 8.5
const { PerformanceObserver, performance } = require('perf_hooks');
const URL = '/api/v1/admin/dashboard';
const ROUTES_ARRAY = [
'/api/v1/admin/dashboard',
'/api/v1/user/private',
'/api/v1/user/public',
'/api/v1/webhook'
];
@tachekent
tachekent / index.html
Created September 25, 2013 15:32
Sticky Footer by Ryan Fait http://ryanfait.com/
<!DOCTYPE html>
<html>
<head>
<title>HTML5 CSS Sticky Footer</title>
<meta name="description" content="The original and simplest sticky footer CSS modified for HTML5.">
<link rel="stylesheet" type="text/css" media="screen" href="layout.css">
</head>