Skip to content

Instantly share code, notes, and snippets.

@mikemurray
mikemurray / gist:20ea196aa6a108a999f03f19b13e88f1
Created May 5, 2020 22:36
iTerm 2 open all my tabs and panes
#!/usr/bin/env python3
import iterm2
# To install, update, or remove packages from PyPI, use Scripts > Manage > Manage Dependencies...
async def main(connection):
# Your code goes here. Here's a bit of example code that adds a tab to the current window:
app = await iterm2.async_get_app(connection)
window = app.current_terminal_window
window = await window.async_create(connection)
### Keybase proof
I hereby claim:
* I am mikemurray on github.
* I am mikemurray (https://keybase.io/mikemurray) on keybase.
* I have a public key ASBJ0Ic1z9Yya6W7jvqC2s2ewSqeK110-bQFybjambpQgwo
To claim this, I am signing this object:
@mikemurray
mikemurray / script.sh
Last active March 25, 2016 17:35
Reaction Docs re-org structure
mkdir -p "1 Introduction"
git mv index.md "1 Introduction/index.md"
git mv admin/dashboard.md "1 Introduction/dashboard.md"
git mv admin/tags.md "1 Introduction/tags.md"
git mv admin/products.md "1 Introduction/products.md"
git mv admin/orders.md "1 Introduction/orders.md"
git mv admin/shipping.md "1 Introduction/shipping.md"
git mv admin/faq.md "1 Introduction/faqs.md"
mkdir -p "2 Developer"
git mv developer/getting-started.md "2 Developer/index.md"
@mikemurray
mikemurray / babel.js
Created March 5, 2016 16:42
Configure meteor babel (meteor 1.3 beta 11)
// ... (add to top of file)
const stage0Preset = Npm.require("babel-preset-stage-0")
// ... (code omitted for brevity)
function getDefaultOptions(extraFeatures) {
// ... (code in function omitted for brevity)
// ... Right before the return, push your preset into the presets array of options
options.presets.push(stage0Preset)
ReactionCore.MethodHooks.before("workflow/pushOrderWorkflow", function (options) {
check(options, Match.OrderHookOptions);
console.log("workflow/pushOrderWorkflow: About to check status", options);
let workflow = options.arguments[0];
let status = options.arguments[1];
let order = options.arguments[2];
if (Meteor.server.method_handlers[workflow]) {
let result = Meteor.call(`workflow/${workflow}/${status}`, options);
@mikemurray
mikemurray / code.md
Last active December 18, 2015 21:44
Proposed steps to setting and validation a workflow status using collection hooks

Somewhere in reaction...

STEP 1: meteor call to push a new workflow

NOTE: coreOrderWorkflow, processing will be combined into coreOrderWorkflow/processing and set as the status.

Meteor.call("workflow/pushOrderWorkflow", "coreOrderWorkflow", "processing", order);

On the server...

STEP 2: workflow/pushOrderWorkflow tries to update the current status

@mikemurray
mikemurray / sublime_settings.json
Created August 23, 2013 17:45
Sublime Text, personal settings
{
"color_scheme": "Packages/Theme - Phoenix/Color Scheme/Clouds Midnight.tmTheme",
"font_size": 12.0,
"ignored_packages":
[
"Vintage",
"SFTP"
],
"indent_guide_options":
[
@mikemurray
mikemurray / transmit_force_unmount.sh
Last active September 14, 2016 13:47
Kill ALL transmit disk sshfs mounts. Use this when you are unable to eject / mount a sshfs volume because of a disconnect. Don't use this to unmount them normally if you have the option. This could be dangerous, so use at your own risk!
# List all running transmit disk tasks
# ---------------------------------------------------------------------------
ps aux | grep "Transmit Disk"
# Kill All transmit disk tasks.
#
# Potentially dangerious as it could apply to all users on system.
# ---------------------------------------------------------------------------
pkill -9 -f "Transmit Disk"
@mikemurray
mikemurray / iteration.php
Created August 6, 2013 21:16
Grid system row assistance for loops.
<?php
// Loop Variables
$max_per_row = 2;
?>
<?php for($i = 0; $i < count($data); $i++): ?>
<?php if($i % $max_per_row == 0 || $i == 0): ?>
<div class="grid-row"> <!-- Start Grid row -->
<?php endif ?>
@mikemurray
mikemurray / Gruntfile.js
Created July 26, 2013 22:02
Gruntfile for PHP and LESS with livereloading
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
php: {
dev: {
options: {
hostname: '127.0.0.1',