I hereby claim:
- I am rfletcher on github.
- I am fletch (https://keybase.io/fletch) on keybase.
- I have a public key whose fingerprint is 3F1A 6410 49F5 8FFA FB75 3962 8013 507D 62FF 7CF0
To claim this, I am signing this object:
/** | |
* A CloudFlare Worker which proxies an RSS feed, ensuring all <link/> values are secure URLs. | |
* | |
* Note: Works for my use case, but this needs more error checking before using widely. | |
* | |
* Usage: https://<yourworker>.workers.dev/https://example.com/feed.rss | |
*/ | |
addEventListener("fetch", event => { | |
event.respondWith(handleRequest(event.request)) |
const HomeAssistant = require( 'homeassistant' ); | |
const Pino = require( 'pino' ); | |
const config = require( 'config' ); | |
const hass = new HomeAssistant( config.get( 'home_assistant' ) ); | |
const imessage = require( 'osa-imessage' ); | |
const logger = Pino(); | |
// TODO package this better | |
const bridge = { |
/** | |
* Bookmarklet to remove duplicate entries from your Last.FM track list. | |
* | |
* Bookmarklet version: | |
* javascript:(%20function()%20{var%20row_to_title%20=%20function(%20$tr%20)%20{return%20$tr.find(%20%22.chartlist-name%20a:not(:empty)[title*=%E2%80%94]%22%20).attr(%20%22title%22%20).replace(%20/\s+/g,%20%27%20%27%20);};jQuery(%20%22table.chartlist%20>%20tbody%20>%20tr%22%20).each(%20function()%20{var%20$tr%20=%20jQuery(%20this%20),$siblings%20=%20jQuery(%20$tr.nextAll(%20%22tr%22%20).slice(%200,%206%20)%20),current_title%20=%20row_to_title(%20$tr%20);$siblings.each(%20function()%20{var%20$sibling%20=%20jQuery(%20this%20),sibling_title%20=%20row_to_title(%20$sibling%20);if(%20sibling_title%20!==%20%22%22%20&&%20current_title%20===%20sibling_title%20)%20{console.log(%20%22Removed%20%22%20+%20sibling_title%20);$sibling.find(%20%22.chartlist-delete%20form%20[type=submit]%22%20).click();return%20false;}});}%20);}()%20); | |
* | |
* Full version: | |
*/ | |
( function() { | |
var row_to_title = function( $tr ) { |
#import <Foundation/Foundation.h> | |
#include <dlfcn.h> | |
NSDictionary *FCPrivateBatteryStatus() | |
{ | |
static mach_port_t *s_kIOMasterPortDefault; | |
static kern_return_t (*s_IORegistryEntryCreateCFProperties)(mach_port_t entry, CFMutableDictionaryRef *properties, CFAllocatorRef allocator, UInt32 options); | |
static mach_port_t (*s_IOServiceGetMatchingService)(mach_port_t masterPort, CFDictionaryRef matching CF_RELEASES_ARGUMENT); | |
static CFMutableDictionaryRef (*s_IOServiceMatching)(const char *name); |
#!/usr/bin/env bash | |
# List all AWS availability zones | |
# | |
# Depends on: | |
# - `aws`: https://aws.amazon.com/cli/ (installed and configured with credentials) | |
# - `jq`: https://stedolan.github.io/jq/ | |
# | |
for REGION in $( | |
aws ec2 describe-regions | jq --raw-output '.Regions | map(.RegionName) | .[]' | sort |
I hereby claim:
To claim this, I am signing this object:
// Restore the removed jQuery.browser API to satisfy dependencies. | |
// | |
// Copied and pasted from the jQuery 1.8.3 source: | |
// http://code.jquery.com/jquery-1.8.3.js | |
( function( jQuery ) { | |
var matched, browser; | |
// Use of jQuery.browser is frowned upon. | |
// More details: http://api.jquery.com/jQuery.browser |
( function() { | |
console.log( 'one' ); | |
//= require two.js | |
}() ); |
# wait for a remote server to start up | |
function wait_for_server() { | |
echo -n "waiting for server to start" | |
for i in {1..10}; | |
do | |
nc "$1" "$2" < /dev/null && echo && return 0; | |
echo -n "." | |
sleep 1 | |
done |
# Redis configuration file example | |
# Note on units: when memory size is needed, it is possible to specifiy | |
# it in the usual form of 1k 5GB 4M and so forth: | |
# | |
# 1k => 1000 bytes | |
# 1kb => 1024 bytes | |
# 1m => 1000000 bytes | |
# 1mb => 1024*1024 bytes | |
# 1g => 1000000000 bytes |