Skip to content

Instantly share code, notes, and snippets.

View vigevenoj's full-sized avatar

Jacob Vigeveno vigevenoj

View GitHub Profile
#!/usr/bin/awk -f
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff
# My copy here is written in awk instead of C, has no compelling benefit.
# Public domain. @thingskatedid
# Run as awk -v x=xyz ... or env variables for stuff?
# Assumptions: the data is evenly spaced along the x-axis
# TODO: moving average
@Jeiwan
Jeiwan / s3_object_tagging.clj
Created January 31, 2017 08:13
S3 Object Tagging with Amazonica
(require '[amazonica.aws.s3 :as s3])
(import '[com.amazonaws.services.s3.model Tag ObjectTagging])
(def bucket "bucket")
(def kkey "key")
(def file (clojure.java.io/file "file"))
(defn tags->tagging [tags]
(->> tags
clojure.walk/stringify-keys
@pesterhazy
pesterhazy / error_boundary.cljs
Last active October 12, 2021 00:19
Reagent error boundary for recovering from exceptions
(ns error-boundary.error-boundary
(:require [reagent.core :as r]
[reagent.impl.component :as comp]
[reagent.impl.util :as util]
[goog.object :as gobj]))
;; (c) 2016 Paulus Esterhazy
;;
;; License: MIT
@wwwins
wwwins / c920.md
Last active December 8, 2022 09:37
live streaming from raspberry pi with logitech usb c920

video stream(v4l2-ctl)

v4l2-ctl --list-devices
mmal service 16.1 (platform:bcm2835-v4l2):
        /dev/video0

HD Pro Webcam C920 (usb-3f980000.usb-1.2):
        /dev/video1
@janus57
janus57 / pi-hole-setup-methode-with-bind9.md
Created November 26, 2016 18:34
Pi-Hole with bind9 as forwarder

Installation of bind9

apt install bind9

Create a virtual interface (eth0:1)

Note: i have the IP : 192.168.1.109 by DHCP

edit the network settings file

@gwillem
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created June 16, 2016 21:59
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# [email protected]
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
from phue import Bridge
import colorsys, time, re, random
#setup bridge
b = Bridge('192.168.XXX.XXX') #hue bridge IP address.
b.connect()
# I grouped the different set's of fixtures in the office into arrays
# which made sense based on their physical locaiton in the office.
# The numbers in the array are the same number used in the hue app to identify
#!/usr/bin/env python
import requests
import json
import paho.mqtt.publish as pahopub
hostname = 'localhost'
port = 1883
topic = 'owntracks/jpm/iss'
auth = { 'username' : 'xxx', 'password' : 'xxx' }
@Deraen
Deraen / 00_notes.md
Last active October 1, 2019 08:40
Compojure-api and Buddy
  • (:identity req) is auth backend independent way to access user data
  • login and logout implementation depends on auth backend
  • :current-user doesn't imply that authentication is required, route should also have :auth-rules if authentication is required