Collection of useful tips & tricks to set up on a Mac.
defaults write -app Safari NSUserKeyEquivalents '{
"Show Next Tab" = "@~\\U2192";
"Show Previous Tab" = "@~\\U2190";
}'
function code-repo --description 'Open current Git repo in VSCode' | |
if not type -q git | |
echo "couldn't find command: git" | |
return 1 | |
end | |
if not type -q code | |
echo "couldn't find command: code" | |
return 1 | |
end |
#!/bin/bash | |
# Calculate the total size of artifacts in GitHub repo (not visible in the UI). | |
# Needs token with the "repo" scope: Profile > Settings > Developer Settings > Personal access tokens | |
# | |
# Requires jq 1.6 or higher. | |
if [ $# -ne 1 ] || [ -z $API_TOKEN ]; then | |
echo "Usage: API_TOKEN=<token> $0 <org/repo>" | |
exit 1 |
# Sample fish shell script to toggle Hue scenes with curl using the home assistant hue service. | |
# See: https://www.home-assistant.io/integrations/hue/#service-hueactivate_scene | |
# | |
# Uses fish shell and jq, `brew install fish jq`. | |
# | |
# Usage: | |
# - export HA_KEY="<api_token_generated_in_home_assistant_ui>" | |
# - tweak the entity_ids to match yours (call /api/states to see available entities) | |
# - save this in fish/functions, and append "ha" to the end of your config.fish to load |
#!/bin/bash | |
# Publish JSON payloads into a RabbitMQ HTTP API with curl and jq. | |
# Usage: rabbit_publish.sh exchange_name '{ "data": "my json payload" }' | |
# | |
# To install prequisites on macOS: | |
# brew install rabbitmq jq | |
# rabbitmq-plugins enable rabbitmq_management | |
if [ $# -ne 2 ]; then |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>HTML5 camera test</title> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
</head> | |
<body> | |
<form> |
Esitys yhtiökokoukselle
Sähköautojen osuus autokannasta kasvaa koko ajan. Valtioneuvoston tavoitteena on, että vuonna 2030 Suomessa olisi jopa 700 000 täyssähköautoa ja lataushybridiä, kun vuoden 2020 lopussa liikennekäytössä oli 9 674 täyssähköautoa ja 45 650 lataushybridiä. Maaliskuussa 2021 voimaan astui laki, jonka myötä taloyhtiöiden pitää varautua sähköautojen määrän kasvuun.
Sähköauton latauksen järjestäminen on yksi keskeisimpiä kysymyksiä sähköauton hankintaa pohtivalle. Sähköauton kotilatauksen toteuttaminen sähkö- ja paloturvallisella tavalla edellyttää lataukseen tarkoitetun suojatun pistorasian tai kiinteän latausaseman asennusta. Lisäksi sähköauton latauksessa taloyhtiössä on huomioitava osakkaiden yhdenvertaisuus.
import * as crypto from "crypto"; | |
type CacheKey = string; | |
type ExpiryTimestamp = number; | |
const log = (...args: any[]) => process.env.DEBUG && console.log(...args); | |
const hashCode = (input: string): string => | |
crypto.createHash("sha256").update(input).digest("hex"); |
# LS_COLORS | |
# Maintainers: Magnus Woldrich <m@japh.se>, | |
# Ryan Delaney <ryan.patrick.delaney@protonmail.com> | |
# URL: https://github.com/trapd00r/LS_COLORS | |
# | |
# This is a collection of extension:color mappings, suitable to use as your | |
# LS_COLORS environment variable. Most of them use the extended color map, | |
# described in the ECMA-48 document; in other words, you'll need a terminal | |
# with capabilities of displaying 256 colors. | |
# |
// Generate a deterministic pseudo UUID (v4), such that the same input always gives the same output. | |
// Potentially useful for test mocks or such where a specific datum is associated to a specific UUIDs, | |
// but doesn't need guarantees against clashing. | |
// With ES6 modules, you can remove the "require" part, and instead import like this: | |
// import { createHash } from "crypto"; | |
const pseudoUuid = (input) => require("crypto") | |
.createHash("sha256") | |
.update(input) |