Skip to content

Instantly share code, notes, and snippets.

View sirtawast's full-sized avatar

Sampo Tawast sirtawast

  • Motley Agency
  • Helsinki, Finland
View GitHub Profile
window.i18n = window.i18n || {};
i18n._langCache = {}
i18n._availableLangs = [
'fi',
'en',
]
i18n._updateElements = function () {
@sirtawast
sirtawast / keybase.md
Created September 11, 2018 09:13
keybase.md

Keybase proof

I hereby claim:

  • I am sirtawast on github.
  • I am sirtawast (https://keybase.io/sirtawast) on keybase.
  • I have a public key ASCVSERxYhKo7xKpQUtvN0jRluTqX1ajMcJdavXXWrweEAo

To claim this, I am signing this object:

@sirtawast
sirtawast / cam.php
Last active October 24, 2018 10:12
Curl stream and buffer webcam stuff, exit from CURLOPT_WRITEFUNCTION with own function
<?php
class CamStream {
protected $code_done = 99999999;
protected $buffer = "";
public function start_stream($url="https://example.org", $passwd="hello:world") {
$exit_ok = false;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
@sirtawast
sirtawast / ha-backup-script.sh
Last active January 9, 2024 10:53
Simple SSH script to backup docker composed Home Assistant data to AWS S3 on my Raspberry Pi 4
#/bin/bash
# Assumes aws-cli installed and configured
# Use crontab or whatever you like to automate
HA_BACKUP_DATE=$(date +"%m-%d")
HA_S3_BUCKET_PATH="my-ha-backups/latest/whatever"
cd /home/$USER/homeassistant
docker compose stop