Skip to content

Instantly share code, notes, and snippets.

View mwesten's full-sized avatar

Max Westen mwesten

View GitHub Profile
@wolph
wolph / lights.yaml
Last active April 11, 2024 01:27
ESPHome Sonoff TX Ultimate T5-3C-86 Custom button component
light:
- platform: neopixelbus
type: GRB
variant: WS2812
pin: GPIO1
num_leds: 1
name: "NeoPixel 1"
internal: true
- platform: neopixelbus
type: GRB
@LanceMcCarthy
LanceMcCarthy / UltimateListIds.md
Last active August 27, 2024 11:16
List of Package Ids
Name Package Id Version Source
7Zip 7zip.7zip 19.0.0 winget
Altap Salamander salamander choco
Alt-Tab Terminator alt-tab-terminator choco
AutoHotkey Lexikos.AutoHotkey 1.1.33.02 winget
AutoHotkey Store Edition HaukeGtze.AutoHotkeypoweredbyweatherlights.com Latest msstore (via winget)
Carnac
@cleverdevil
cleverdevil / upload-insta.py
Created March 5, 2018 01:38
Upload my directory full of instagram photos to my website, using granary to look up the metadata
#!/usr/bin/env python
import os
import sys
import requests
base_url = 'https://granary.io/instagram/cleverdevil/@self/@app/%s'
query_args = {
'format': 'mf2-json',
@cleverdevil
cleverdevil / process_albums.py
Created March 5, 2018 01:20
Process fb-export album data, upload the photos to a Micropub media endpoint, and export MF2-JSON data for posts
#!/usr/bin/env python
'''
Conditionally upload all of the photos from an exported Facebook album to a
Micropub-compatible website with a media endpoint, and dump MF2-JSON data
that can later be published to the same Micropub website.
'''
import json
import sys
@adactio
adactio / monthmap.php
Last active December 27, 2018 07:21
Display a heat calendar for a month of data.
<?php
// Create an array of timestamps for posts
// and put them into an array called $timestamps.
foreach ($timestamps as $timestamp) {
$day = date("j", $timestamp);
$hour = date("G", $timestamp);
if (isset($heatcalendar['posts'][$day][$hour])) {
$heatcalendar['posts'][$day][$hour]++;
@ttscoff
ttscoff / init.lua
Last active January 9, 2024 23:44
Hammerspoon config examples for hyper key
-- A global variable for the Hyper Mode
k = hs.hotkey.modal.new({}, "F17")
-- Trigger existing hyper key shortcuts
k:bind({}, 'm', nil, function() hs.eventtap.keyStroke({"cmd","alt","shift","ctrl"}, 'm') end)
-- OR build your own
launch = function(appname)
@ojkelly
ojkelly / init.lua
Last active March 30, 2021 04:57
My hammerspoon config
local usbWatcher = nil
-- This is our usbWatcher function
-- lock when yubikey is removed
function usbDeviceCallback(data)
-- this line will let you know the name of each usb device you connect, useful for the string match below
hs.notify.show("USB", "You just connected", data["productName"])
-- Replace "Yubikey" with the name of the usb device you want to use.
if string.match(data["productName"], "Yubikey") then
if (data["eventType"] == "added") then
@craigeley
craigeley / sifttter.rb
Last active July 23, 2018 16:37
This script looks for text files in a specific folder that include completed tasks ('@done') and timestamps, and then collects them into a daily log for the Day One journaling application. It works especially well when it's connected to IFTTT. See more details at http://craigeley.com/tagged/sifttter
#!/usr/bin/ruby
# SIFTTTER 1.5: An IFTTT-to-Day One Logger by Craig Eley 2014 <http://craigeley.com>
# Based on tp-dailylog.rb by Brett Terpstra 2012 <http://brettterpstra.com>
# Multiple Date Function by Paul Hayes 2014 <http://paulrhayes.com>
#
# Notes:
# * Uses `mdfind` to locate a specific folder of IFTTT-generated text files changed in the last day
# * The location of your folder should be hardcoded in line 67, and the location of your Day One in line 66
# * Scans leading timestamps in each line matching the selected dates
# * Does not alter text files in any way
@JeffreyWay
JeffreyWay / snippet.xml
Created September 13, 2012 20:23
Laravel Resource - Sublime Text 2 Snippet
<snippet>
<content><![CDATA[
// ${1} Resource
Route::get('${1}s', array('as' => '${1}s', 'uses' => '${1}s@index'));
Route::get('${1}s/(:any)', array('as' => '${1}', 'uses' => '${1}s@show'));
Route::get('${1}s/new', array('as' => 'new_${1}', 'uses' => '${1}s@new'));
Route::get('${1}s/(:any)edit', array('as' => 'edit_${1}', 'uses' => '${1}s@edit'));
Route::post('${1}s', '${1}s@create');
Route::put('${1}s/(:any)', '${1}s@update');
Route::delete('${1}s/(:any)', '${1}s@destroy');
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik