Skip to content

Instantly share code, notes, and snippets.

View sorny's full-sized avatar
:shipit:
Dies Das 🍍

Gerald Reisinger sorny

:shipit:
Dies Das 🍍
View GitHub Profile
@ajlai
ajlai / date_series_redshift.sql
Created February 9, 2015 20:09
Date series on redshift
WITH date_series_bounds AS (
SELECT date('2012-12-21') as start, date('2013-08-23') as end
), date_series AS (
select date(days.start + days.interval)
from (
select bounds.start, generate_series(0, bounds.end - bounds.start) AS interval from date_series_bounds bounds
) as days
)
select * from date_series
-- 2012-12-21
@ewheeler
ewheeler / overpass-turbo-admin-boundaries-query.js
Last active October 4, 2023 01:27
Overpass-Turbo query for viewing administrative boundaries
/*
This is an example Overpass query to view administrative boundaries.
1. Visit the OpenStreetMaps wiki (http://wiki.openstreetmap.org/wiki/Tag:boundary%3Dadministrative) and see which levels are present for your country. If admin_level = N/A, that level is missing.
2. Go to http://overpass-turbo.eu and centre the map on the country of interest.
3. Delete the text on the left side of the overpass-turbo page and replace with the contents of this file
4. Edit the admin_level to the level you want to check - in the example above, the "admin_level" = "8". Press 'Run' to highlight and outline all boundaries for that level.
@xoseperez
xoseperez / rpi3_iot_server.md
Last active February 11, 2024 15:05
Raspberry Pi 3 with Mosquitto, Node-RED, InfluxDB, Grafana and Nginx (as a reverse proxy)
@abmantis
abmantis / m5stack-atom-matrix-esphome.yaml
Created July 4, 2023 21:06
M5Stack Atom Matrix ESPHome
esphome:
name: m5-atom-matrix
platformio_options:
upload_speed: 115200
on_boot:
priority: 700
then:
- output.turn_on: wifi_fix_output
esp32:
@denisgolius
denisgolius / install-victoriametrics-single-ubuntu.sh
Last active April 5, 2025 17:25
install VicotriaMetrics Single on ubuntu 20.04
#!/bin/bash
set -e
system_set_hostname "$HOSTNAME"
apt update && apt upgrade -y && apt install -y curl wget net-tools traceroute jq
# Generate files
mkdir -p /etc/victoriametrics/single
mkdir -p /var/lib/victoria-metrics-data
@kaspergrubbe
kaspergrubbe / geonames_postgres.rb
Last active April 15, 2025 21:39
Import files from Geonames.com into a PostgreSQL database that runs Postgis
#!/usr/bin/env ruby
require 'open3'
require 'fileutils'
def run_command(command)
puts("+: " + command)
Open3.popen2e(command) do |stdin, stdout_stderr, wait_thread|
Thread.new do
stdout_stderr.each {|l| puts l }
@bmweiner
bmweiner / sonos_airplay.md
Last active June 11, 2025 11:01
Stream audio to any Sonos component via AirPlay using a Raspberry Pi.

Sonos Airplay

Stream audio to any Sonos component via AirPlay using a Raspberry Pi (Model B, Raspbian Jessie) and the following software:

  • Shairport Sync: configures the Raspberry Pi as an AirPlay audio player.
  • DarkIce: encodes audio received from AirPlay (system audio) and sends it to Icecast2.
  • Icecast2: serves streaming audio from DarkIce at a network URL.
@Azuritul
Azuritul / .gitignore
Last active August 2, 2025 14:09
General .gitignore file sample
# IDEA Ignores #
################
*.iml
*.ipr
*.iws
.idea/
out/
local.properties
# Generic Android ignores #
@nitaku
nitaku / README.md
Last active August 4, 2025 01:28
Minimal JSON HTTP server in python

A minimal HTTP server in python. It sends a JSON Hello World for GET requests, and echoes back JSON for POST requests.

python server.py 8009
Starting httpd on port 8009...
curl http://localhost:8009
{"received": "ok", "hello": "world"}
@ChipCE
ChipCE / readme.md
Last active May 20, 2026 13:44
Klipper bed mesh on print area only macro install guide

READ THIS FIRST

Adaptive bed mesh is merged into klipper master branch. You can use this feature without this custom macro. Official klipper adaptive bed mesh

Klipper mesh on print area only install guide

What this macro do

  • This macro will dynamically changing the bed mesh area based on the size of the parts will be printed. The fw will only probe on the area that the part will be printed (plus mesh_area_offset value)