Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View tdmalone's full-sized avatar

Tim Malone tdmalone

View GitHub Profile
@tdmalone
tdmalone / config
Created June 7, 2016 00:45
Add this in ~/.ssh to use a custom SSH key for communicating with GitHub
Host github.com
HostName github.com
IdentityFile ~/.ssh/github_rsa
IdentitiesOnly yes
User git
@tdmalone
tdmalone / hottest100.php
Last active January 26, 2017 23:53
Cron this every minute or two on a server with PHP installed, to post every new hottest 100 track to a Slack channel
<?php
// ********************* START CONFIGURATION *********************
// Set up an incoming webhook at https://YOURDOMAIN.slack.com/apps/manage/custom-integrations
define( 'SLACK_INCOMING_WEBHOOK', 'https://hooks.slack.com/services/TXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX' );
// Set your data folder, which is used to prevent multiple notifications for the same song :)
define( 'DATA_FOLDER', './hottest100-data' );

Keybase proof

I hereby claim:

  • I am tdmalone on github.
  • I am tdmalone (https://keybase.io/tdmalone) on keybase.
  • I have a public key ASDxTp43bJ3xQUzZcd6LrketZZi53NEL-uIOgj7YgMUB5go

To claim this, I am signing this object:

@tdmalone
tdmalone / .travis-lambda-python.yml
Last active March 14, 2018 21:39
.travis.yml example for Python Lambda microservice testing and deployment
language: python
services: docker
python: 3.6
env:
global:
- AWS_ACCESS_KEY_ID=...
- AWS_DEFAULT_REGION=ap-southeast-2
# Coming soon.
@tdmalone
tdmalone / .travis-lambda-node.yml
Last active December 12, 2018 02:12
.travis.yml example for Node.js Lambda microservice testing and deployment
language: node_js
services: docker
node_js: 6.10
env:
global:
- AWS_ACCESS_KEY_ID=...
- AWS_DEFAULT_REGION=ap-southeast-2
@tdmalone
tdmalone / static-site-watch.sh
Last active June 17, 2021 08:03 — forked from senko/onchange.sh
Watch specified directory recursively for file changes, and sync it to S3 when anything is created, modified, moved or deleted. Designed for use with a static site generator.
#!/usr/bin/env bash
#
# Watch specified directory recursively for file changes, and sync it to S3 when anything is
# created, modified, moved or deleted. Designed for use with a static site generator.
#
# Originally based on a script by Senko Rasic <senko.rasic@dobarkod.hr>
# Modified by Tim Malone <tdmalone@gmail.com>
# Ideas included from Lambros Petrou <lambrospetrou@gmail.com>
# Released to public domain.
# See https://gist.github.com/senko/1154509
@tdmalone
tdmalone / cloudSettings
Last active March 13, 2022 00:48
Tim's VSCode Settings. If you want to use these to bootstrap a new VSCode install, manually install the code-settings-sync extension first and set "sync.gist" in your settings to "6ec3fafda73b42a5b21a5b2ae5384ced". Then download a sync, and all the other extensions will be downloaded for you. Then remove the gist setting so you can sync your own.
{"lastUpload":"2022-03-13T00:48:37.867Z","extensionVersion":"v3.4.3"}
@tdmalone
tdmalone / pocket.sh
Created October 26, 2022 07:35
Quick script to get your most recently added, untagged article in Pocket
#!/usr/bin/env bash
set -euo pipefail
#################################################
# Create an app at https://getpocket.com/developer/apps/new
# and enter the consumer key below
# Then you're good to go!
@tdmalone
tdmalone / aws-services.py
Created December 28, 2023 04:39
Using an undocumented (and thus subject-to-change) API, provides a list of all AWS services colourised as to whether or not they're available in the given region. Alternatively, given two regions, colourised based on whether services are available in one region, both regions, or neither of them.
#!/usr/bin/env python
import json, sys
from urllib.request import urlopen
def green(str): return f'\033[92m{str}\033[0m'
def orange(str): return f'\033[38;5;214m{str}\033[0m'
def red(str): return f'\033[91m{str}\033[0m'
def yellow(str): return f'\033[93m{str}\033[0m'