Skip to content

Instantly share code, notes, and snippets.

View bryanbuchanan's full-sized avatar

Bryan Buchanan bryanbuchanan

View GitHub Profile
@bryanbuchanan
bryanbuchanan / basecamp-shortcuts.js
Last active December 18, 2025 16:57
Basecamp Keyboard Shortcuts
/* BASECAMP KEYBOARD SHORTCUTS
This is a quick and dirty hack to add Edit (cmd+e) and Save (cmd+s) keyboard shortcuts to Basecamp.
Requires Google Chrome and the 'User JavaScript and CSS' Chrome extension (https://chromewebstore.google.com/detail/user-javascript-and-css/nbhcbdghjpllgmfilhnhkllmkecfmpld)
1. With the extension installed and while viewing Basecamp, click the User JavaScript and CSS item from the extensions menu.
2. Click 'New Rule...'
3. In the field labelled 'Start typing JavaScript here...", paste the following code and Save.
4. Return to your Basecamp tab and refresh. Shortcuts should then work!
title: Mesa # Human-readable theme name to be used in UI
name: mesa # camelCase theme name to be used by system
image: image.jpg # Name of theme preview image file
options: # List of categories of customizable properties
- name: logo
title: Logo
properties:
- image: true
name: logoImage
@bryanbuchanan
bryanbuchanan / private-trello-attachment-proxy.js
Last active October 25, 2022 16:50
Make private Trello board attachments publicly-available. https://glitch.com/edit/#!/private-trello-attachment-proxy
require('dotenv').config()
const express = require('express')
const fetch = require('node-fetch')
const app = express()
app.use('/', async (req, res) => {
// Attachment URL
const attachmentURL = "https://trello.com/1/cards/5e65954f0f343116e999658f/attachments/5e67a146876719748d64057b/previews/5e67a147876719748d6405ae/download"
import os
import sys
directory = os.path.dirname(os.path.realpath(sys.argv[0]))
for dirpath, dirnames, files in os.walk(directory):
if not files:
os.rmdir(dirpath)
import os
import sys
directory = os.path.dirname(os.path.realpath(sys.argv[0]))
for subdir, dirs, files in os.walk(directory):
for filename in files:
if filename.find('old_suffix_1') > 0:
subdirectoryPath = os.path.relpath(subdir, directory)
filePath = os.path.join(subdirectoryPath, filename)
@bryanbuchanan
bryanbuchanan / cdtms.markdown
Created July 18, 2014 20:55
A Pen by Bryan Buchanan.
@bryanbuchanan
bryanbuchanan / GetShapeArea.jsx
Last active July 8, 2025 04:24
Script to find the area of shapes in Adobe Illustrator
/* Save this file with a jsx extension and place in your
Illustrator/Presets/en_US/Scripts folder. You can then
access it from the File > Scripts menu */
var decimalPlaces = 3;
if (app.documents.length > 0) {
if (app.activeDocument.selection.length < 1) {
alert('Select a path');
imgLoader = new Image();
imgLoader.onload = function(data) {
// Desired size
var max_width = 600;
var max_height = 600;
// Get image dimensions
var original_width = imgLoader.width;
var original_height = imgLoader.height;
<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<!-- Test image -->
<img src="http://m1.22slides.com/bryanbuchanan/4317_image_374612.jpg" alt="Image">
@bryanbuchanan
bryanbuchanan / flickr_id_to_profile.php
Created April 23, 2013 01:52
Takes a Flickr users's ID and finds their profile on Flickr.com
<?php
if (isset($_POST)) {
// Get user ID
$user_id = $_POST['user_id'];
// Data to send to Flickr API
$data = array(
"method" => "flickr.people.getInfo",
"user_id" => $user_id,