Skip to content

Instantly share code, notes, and snippets.

@tetele
tetele / README.md
Last active January 22, 2025 06:49
ESPHome config - Onju Voice/Home as a voice assistant satellite in Home Assistant
@natterstefan
natterstefan / backup.sh
Created May 1, 2019 05:41
Raspberry Pi | Backup and Sync Pi-hole and UniFi data from a Raspberry Pi to Google Drive
#!/bin/bash
# create backup folders (if they do not exist yet)
mkdir -p ~/backups
mkdir -p ~/backups/unifi
mkdir -p ~/backups/pihole
# backup pi-hole
(cd ~/backups/pihole && pihole -a teleporter)
class PostsController < ActionController::Base
def create
Post.create(post_params)
end
def update
Post.find(params[:id]).update_attributes!(post_params)
end
private
@DarkFox
DarkFox / gist:1564985
Created January 5, 2012 12:03
Insert translation tag (Copying any selected text to clipboard)
`if [[ "${TM_SELECTED_TEXT}" != "" ]]
then printf "'${TM_SELECTED_TEXT}'" | pbcopy
fi`${TM_RAILS_TEMPLATE_START_RUBY_EXPR}t '${1:key}'${TM_RAILS_TEMPLATE_END_RUBY_EXPR}