Skip to content

Instantly share code, notes, and snippets.

Avatar

Ben Fritsch beanieboi

View GitHub Profile
@beanieboi
beanieboi / home assistant.yml
Last active Aug 1, 2021
HomeAssistant Luftdaten REST API - Air Quality, PM2.5, PM10, Temp and Humidity (SDS011 and DHT22)
View home assistant.yml
sensor:
- platform: rest
name: luftdaten
resource: http://192.168.1.149/data.json
scan_interval: 100
json_attributes:
- sensordatavalues
value_template: '{{ value_json.age }}'
- platform: template
sensors:
@beanieboi
beanieboi / batch-updates.sql
Last active Mar 11, 2019
My Postgres Cheatsheet
View batch-updates.sql
DO LANGUAGE plpgsql $$
DECLARE counter INTEGER = 1;
DECLARE tick INTEGER = 1;
BEGIN
WHILE counter > 0 LOOP
UPDATE table
SET field = NULL
WHERE id IN (
SELECT id
FROM table
View freebsd.txt
mkdir /tmp/zroot
zpool import -fR /tmp/zroot zroot
mkdir /tmp/root
mount -t zfs zroot/ROOT/default /tmp/root
View codeship_restart_build.rb
#!/home/rof/.rvm/rubies/ruby-2.2.0/bin/ruby
require 'json'
require 'net/http'
class CodeshipRestartBuild
def self.restart_build
self.new.restart_build
end
View bitmask.go
package bitmask
import (
"encoding/binary"
"bytes"
"fmt"
)
type Channelmask struct {
A3 bool
@beanieboi
beanieboi / wifi.json
Last active Jan 22, 2016
Hackerbeach Wifi Passwords
View wifi.json
{
"places": [
{
"name": "Surf Shak",
"SSID": "Bar Surf",
"password": "shak2525"
},
{
"name": "Hostal Rutamar",
"SSID": "HOSTAL RUTAMAR",
View gist:9fe9892842820b8ec915
NoMethodError at /merchants/xxx/transparent_redirect_requests
undefined method `[]' for nil:NilClass
file:
base.rb
location: html?
line:
117
BACKTRACE
(expand)
JUMP TO:
View .rubocop.yml
AllCops:
Exclude:
- config/**/*
- db/**/*
Metrics/LineLength:
Description: 'Limit lines to 120 characters.'
Max: 120
Metrics/CyclomaticComplexity:
@beanieboi
beanieboi / gist:ad526faf063181f336a2
Last active Sep 13, 2021
Codeship Nginx Config for Heroku
View gist:ad526faf063181f336a2
daemon off;
# Heroku dynos have at least 4 cores.
worker_processes <%= ENV['NGINX_WORKERS'] || 4 %>;
events {
use epoll;
accept_mutex on;
worker_connections 1024;
}
View gist:84b0b86238952e6636c9
# For more information visit the GitHub documentation: https://github.com/krausefx/deliver
# Everything next to a # is a comment and will be ignored
# hide_transporter_output # remove the '#' in the beginning of the line, to hide the output while uploading
########################################
# App Metadata
########################################