Skip to content

Instantly share code, notes, and snippets.

@rpanachi
rpanachi / command_line.yaml
Last active November 5, 2024 12:56
Tuya api script (for home assistant)
- sensor:
name: Tuya Power Clamp
unique_id: tuya_power_clamp
command: "python3 /config/tuya.py device_id"
device_class: power
state_class: total_increasing
unit_of_measurement: Wh
scan_interval: 60
value_template: "{{ value_json.EnergyConsumed | float(0) * 10 }}"
eufy:
image: bropat/eufy-security-ws
container_name: eufy
restart: unless-stopped
environment:
- USERNAME=email
- PASSWORD=pass
- COUNTRY=country
ports:
- 3000:3000
@rpanachi
rpanachi / lorem.txt
Created July 25, 2019 03:32
lorem.txt
Lorem ipsum
Dolor sit amet
Vestibulum vitae
Morbi iaculis elit
Sed porta ante
Magna faucibus
Lorem
Ipsum
Lorem
Dolor
Vitae
Magna
Dolor
Lorem
@rpanachi
rpanachi / how-to-fix-macos-mojave-battery-draining-issue.md
Last active April 20, 2023 13:31
How to Fix macOS Mojave Battery Draining Issue
@rpanachi
rpanachi / char.scad
Created December 17, 2018 01:06 — forked from tbuser/char.scad
latest version now at: http://github.com/tbuser/openscad-bitmap
module make_atari_bitmap(char, block_size, height, include_base) {
if (char == "0") {
make_bitmap([
0,0,0,0,0,0,0,0,
0,0,1,1,1,1,0,0,
0,1,1,0,0,1,1,0,
0,1,1,0,1,1,1,0,
0,1,1,1,1,1,1,0,
@rpanachi
rpanachi / README.md
Last active October 16, 2024 01:39 — forked from brennanneoh/README.md
Anet A8 Printer Profile for Cura 3D

Setup

  1. Install Cura 2.4
  2. Copy anet_a8.def.json to ~/Library/Application Support/cura/3.4/definitions
  3. Open Cura
  4. Expand Custom, then select Anet A8
  5. Click Finish
@rpanachi
rpanachi / db.rake
Created April 10, 2016 21:26
Rakefile for Sequel database operations
namespace :db do
require 'sequel'
Sequel.extension(:migration)
MIGRATIONS_PATH = 'db/migrations'
def db_conn_env
ENV["BOOKSHELF_DATABASE_URL"]
end
@rpanachi
rpanachi / tsocks.conf
Created May 25, 2015 12:13
tsocks.conf
# This is the configuration for libtsocks (transparent socks)
# Lines beginning with # and blank lines are ignored
#
# The basic idea is to specify:
# - Local subnets - Networks that can be accessed directly without
# assistance from a socks server
# - Paths - Paths are basically lists of networks and a socks server
# which can be used to reach these networks
# - Default server - A socks server which should be used to access
# networks for which no path is available
@rpanachi
rpanachi / skip_validation.rb
Last active August 29, 2015 14:09
Skip Validation
# source: http://gistflow.com/posts/749-canceling-validations-in-activerecord
# declaration
def skipping_validation(methods, &block)
skipped_validations = methods.map do |method, kinds|
Array(kinds).map do |kind|
_validators[method].select { |v| v.kind == kind }.map do |validation|
_validate_callbacks.select { |c| c.filter == validation }.map do |callback|
_validate_callbacks.delete(callback)
end