Skip to content

Instantly share code, notes, and snippets.

View bdsexton's full-sized avatar

Brian Sexton bdsexton

View GitHub Profile
@bdsexton
bdsexton / csv-trees.md
Last active July 25, 2022 03:50
Generate File System Trees in CSV Format with "tree" and "sed"

Generate File System Trees in CSV Format with "tree" and "sed"

Description

I don't know whether this will be useful to anyone else, but I wanted to use the Linux tree command to generate file system trees in CSV format on OS X. This should work pretty much as is on Linux, although you may need or want to change the paths and optimize the usage of sed.

Dependency

This uses the Linux "tree" command, which is not standard on OS X.

@bdsexton
bdsexton / Generate UUID.scpt
Created May 4, 2012 04:28
Generate UUID via AppleScript
do shell script "uuidgen"
set uuid to (get result)
display dialog "Have a UUID on the house:" with title "UUID Generator" default answer uuid buttons "OK" default button "OK"
@bdsexton
bdsexton / Move and Resize Current Application.scpt
Created May 4, 2012 04:34
Move and Resize Current Application via AppleScript
-- Adapted from http://www.ithug.com/2007/09/applescript-moving-and-resizing-windows/:
tell current application
activate
set the bounds of the first window to {0, 0, 1024, 768}
end tell
@bdsexton
bdsexton / load.js
Created February 1, 2015 18:58
Non-Destructive load-Event Handler
window.addEventListener("load", function(event) {
console.log("Hello! Non-destructive load-event handlers are the best kind! Don't you agree?");
console.log("load event: %o", event);
});
@bdsexton
bdsexton / angularjs-directive-module.js
Created November 27, 2014 10:13
An AngularJS Directive via Isolated Module JavaScript
(function() {
/*
An AngularJS Directive via Isolated Module JavaScript
This is just a simple example of an AngularJS module that defines a
directive within an immediately invoked function expression, which can
be stored in and loaded from a separate file for clear, lean code
organization and easy distribution.
@bdsexton
bdsexton / .gitignore
Last active August 29, 2015 14:07
This is just a simple .gitignore file to ignore common clutter.
# OS X
.DS_Store
# Adobe Dreamweaver
_notes/
# Sublime Text
*.sublime-project
*.sublime-workspace
# JetBrains IDEs
.idea/
# CodeKit
@bdsexton
bdsexton / template.sublime-project
Created October 5, 2014 23:30
This is just a simple Sublime Text 2 project file template that excludes some common clutter.
{
"folders":
[
{
"path": "/path/to/project/root",
"file_exclude_patterns": [".gitignore", "*.sublime-*"],
"folder_exclude_patterns": [".idea"]
}
]
}
@bdsexton
bdsexton / Main.sublime-menu
Created April 4, 2014 23:27
New Sublime Text Layouts (One Left and Two Right & Two Left and One Right) via Menu
[
{
"caption": "View",
"mnemonic": "V",
"id": "view",
"children":
[
{
"caption": "Layout",
"mnemonic": "L",
javascript:(function(){/* Do stuff here. */}());void(0);
outline: 1px dotted rgba(255, 0, 255, 0.5);
outline-offset: -1px;