Skip to content

Instantly share code, notes, and snippets.

View matthewhudson's full-sized avatar

Matthew Hudson matthewhudson

View GitHub Profile
@matthewhudson
matthewhudson / atom-macos-context-menu.md
Created May 25, 2019 08:52 — forked from idleberg/atom-macos-context-menu.md
“Open in Atom” in macOS context-menu

Open in Atom

  • Open Automator
  • Create a new Service
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /usr/local/bin/atom -n "$@"
  • Set “Pass input” to as arguments
  • Save as Open in Atom
@matthewhudson
matthewhudson / streamDecodedVideo.js
Created May 25, 2019 08:14 — forked from yoannmoinet/streamDecodedVideo.js
Stream video back in correct format.
import ffmpeg form 'fluent-ffmpeg';
const filePath = '/Users/yoann/Desktop/video.avi';
const route = (req, res) => {
res.writeHead(200, getHeaders({'Content-Type': 'video/mp4'}));
ffmpeg(filePath)
.format('mp4')
.addOptions([
'-movflags frag_keyframe+faststart'
])
@matthewhudson
matthewhudson / static-server.coffee
Last active December 15, 2015 08:19 — forked from ryanflorence/static_server.js
Run a static server from any directory.
http = require 'http'
url = require 'url'
path = require 'path'
fs = require 'fs'
port = process.argv[2] or 8888
headers =
'Content-Type': 'text/plain'
http.createServer( (request, response) ->
uri = url.parse(request.url).pathname
@matthewhudson
matthewhudson / functions.php
Created September 4, 2012 13:41 — forked from abecoffman/functions.php
Adds Facebook Graph meta tags to Wordpress blog pages and thumbnail support to your Wordpress theme
<?php
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'post-thumbnails' );
}
function the_facebook_graph_data() {
// setup the default site attributes
$graph;
$graph["site_name"] = "YOUR_SITE_NAME";
@matthewhudson
matthewhudson / ExampleClass.m
Created March 17, 2012 03:31 — forked from lukeredpath/ExampleClass.m
Macro for creating your "shared instance" using GCD
@implementation MySharedThing
+ (id)sharedInstance
{
DEFINE_SHARED_INSTANCE_USING_BLOCK(^{
return [[self alloc] init];
});
}
@end
@matthewhudson
matthewhudson / .osx
Created March 8, 2012 05:00 — forked from dennmart/.osx
Sensible defaults for Mac OS X Lion
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
# Disable the “Are you sure you want to open this application?” dialog
defaults write com.apple.LaunchServices LSQuarantine -bool false
# Disable shadow in screenshots
defaults write com.apple.screencapture disable-shadow -bool true
# Automatically open a new Finder window when a volume is mounted