Skip to content

Instantly share code, notes, and snippets.

@Wowfunhappy
Wowfunhappy / gist:372a63a00d10847674346dd3dd385a3c
Last active July 12, 2018 18:56
I save all my super secret thievery information in a plain text file on my computer. Once you've logged in, enter this command.
nano ~/secret-thief-info.txt
@Wowfunhappy
Wowfunhappy / podcast-downloader.sh
Created July 14, 2019 21:05
Podcast Downloader
#!/bin/bash
#
#
# Description: A simple bash script to download most recent media from a podcast XML feed
#
# Usage: sh podcast-download.sh http://myfeed.com/rss /PATH/TO/folder
#
# Based on script by Andrew Morton: https://github.com/mortocks/bash-podcast-download
# Heavily modified by Wowfunhappy
#
@Wowfunhappy
Wowfunhappy / index.html
Last active September 13, 2019 17:11
Pebble RSS Reader Settings
<!DOCTYPE html>
<html>
<head>
<title>Pebble RSS Reader Configuration</title>
</head>
<body>
<div id="allFeedForms">
<h3>RSS Feeds</h3>
</div>
@Wowfunhappy
Wowfunhappy / app.js
Created October 1, 2019 19:21
Pebble: Create Timeline Pins When It Will Rain with DarkSky API
var darkSkyApiKey = ""
/*
In theory (untested), this app should work once you (1) add an api key from dark sky and (2) replace the three fantasy functions with real code.
*/
var UI = require('ui');
var ajax = require('ajax');
var blackStatusBar = {
@Wowfunhappy
Wowfunhappy / proxy.php
Last active July 13, 2020 21:58 — forked from iovar/proxy.php
Simple PHP Proxy Script
<?
/**
* A simple PHP proxy.
* Based on https://gist.github.com/iovar/9091078
* Modified by Wowfunhappy
*
* Usage: http://path/to/proxy.php?example.com
*/
//todo: handle root relative URLS. Pass in request to URLFixer and let it handle sub-functions.
addEventListener('fetch', event => {
event.respondWith(forwardRequest(event.request));
})
async function forwardRequest(req) {
var inputURL = getInputURLFromRequest(req);
var init = {
method: req.method,
addEventListener('fetch', event => {
event.respondWith(forwardRequest(event.request));
})
async function forwardRequest(req) {
var url = getURLFromRequest(req);
var init = {
method: req.method,
headers: req.headers,
body: req.body,
@Wowfunhappy
Wowfunhappy / patches.diff
Created August 24, 2020 20:18
Docker Machine + VMWare Fusion on Mavericks
1. Reset Macports tree to revision 9bbc6e46bc525b714dbea0d10970f29f18bcc7de
2. sudo port install Docker
3. Edit Docker-Machine port file, change version to 0.16.2 and update checksums and size to match, taking from https://github.com/macports/macports-ports/blob/c534c086278121e3f558490cb1baeb011162c93d/devel/docker-machine/Portfile
4. Add in below diff patches. Removes the error checking that actually just ends up breaking everything, see: https://github.com/docker/machine/issues/4479#issuecomment-464355478. Also disables suspend in vmware because that screws up stuff.
5. Install docker-machine, save build docker-machine and docker binaries.
@Wowfunhappy
Wowfunhappy / web-sharing.sh
Last active December 4, 2020 21:18
Enable Apache
#!/bin/bash
if (( $(echo "${OSTYPE:6} > 13" | bc -l) ))
then
mkdir ~/Sites ; sudo bash -c "printf '<Directory \"/Users/`whoami`/Sites/\">\n\tAddLanguage en .en\n\tAllowOverride All\n\tOptions Indexes MultiViews FollowSymLinks\n\tRequire all granted\n</Directory>' > /etc/apache2/users/`whoami`.conf ; echo 'AddDefaultCharset utf-8' >> /etc/apache2/httpd.conf ; sed -i '' '/LoadModule userdir_module libexec\/apache2\/mod_userdir.so/s/^#*//g' /etc/apache2/httpd.conf ; sed -i '' '/LoadModule php[0-9]*_module libexec\/apache2\/libphp[0-9]*.so/s/^#*//g' /etc/apache2/httpd.conf ; sed -i '' '/Include \/private\/etc\/apache2\/extra\/httpd-userdir.conf/s/^#*//g' /etc/apache2/httpd.conf ; sed -i '' '/Include \/private\/etc\/apache2\/users\/\*.conf/s/^#*//g' /etc/apache2/extra/httpd-userdir.conf ; apachectl start"
elif (( $(echo "${OSTYPE:6} > 10" | bc -l) ))
then
mkdir ~/Sites ; sudo bash -c "printf '<Directory \"/Users/`whoami`/Sites/\">\n\tAddLanguage en .en\n\tAllowOverride All\n\tOptions Indexes MultiViews Follow
@Wowfunhappy
Wowfunhappy / ChromiumMavericksWorkarounds.m
Created February 6, 2021 20:25
Compile this into a dylib and inject with DYLD_INSERT_LIBRARIES to make Chromium Legacy work on Mavericks
#import <Cocoa/Cocoa.h>
#import <AppKit/AppKit.h>
#import "ZKSwizzle.h"
#define DYLD_INTERPOSE(_replacement,_replacee) \
__attribute__((used)) static struct{ const void* replacement; const void* replacee; } _interpose_##_replacee \
__attribute__ ((section ("__DATA,__interpose"))) = { (const void*)(unsigned long)&_replacement, (const void*)(unsigned long)&_replacee };
//Left to its own devices, Mavericks CoreFoundation will release a CTFontRef which Chromium later