Skip to content

Instantly share code, notes, and snippets.

View marcusmoore's full-sized avatar

Marcus Moore marcusmoore

View GitHub Profile
@marcusmoore
marcusmoore / current-dir-in-iterm-tab-title.sh
Created August 27, 2018 20:00 — forked from phette23/current-dir-in-iterm-tab-title.sh
Set the iTerm tab title to the current directory, not full path.
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi
# Piece-by-Piece Explanation:
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too
# the $PROMPT_COMMAND environment variable is executed every time a command is run
# see: ss64.com/bash/syntax-prompt.html
@marcusmoore
marcusmoore / README-Template.md
Created January 8, 2018 23:30 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Keybase proof

I hereby claim:

  • I am marcusmoore on github.
  • I am marcusmoore (https://keybase.io/marcusmoore) on keybase.
  • I have a public key whose fingerprint is E59E 7948 59BD D7F1 2B69 07FB 1A13 8850 AD35 AFF5

To claim this, I am signing this object:

.MediaObject {
@include media-object-container;
&__section{
@include media-object-section();
}
}
@marcusmoore
marcusmoore / AppServiceProvider.php
Created March 18, 2016 00:18 — forked from snipe/AppServiceProvider.php
Validate email array in Laravel 5.2 wth custom validator
<?php
/**
* This service provider handles a few custom validation rules.
*
* PHP version 5.5.9
* @package Snipe-IT
* @version v3.0
*/
namespace App\Providers;
@marcusmoore
marcusmoore / bookmarklet.js
Created December 1, 2015 19:16
Bookmarklet: Grab mp4 from a webpage
/* Very specific to my use case */
/* ORIGINAL CODE */
// Regex pattern
var re = /src="(.*?)"\s{1,}type="video\/mp4"/;
// Scan DOM for a match
var array = re.exec(document.body.innerHTML);
@marcusmoore
marcusmoore / gulpfile.js
Created October 8, 2015 20:33
Example Stylus Kouto-Swiss gulpfile
var gulp = require('gulp');
var util = require('gulp-util');
var concat = require('gulp-concat');
var stylus = require('gulp-stylus');
var kouto = require('kouto-swiss');
var poststylus = require('poststylus');
var paths = {
styles: {
@marcusmoore
marcusmoore / GCalUtils.md
Created September 23, 2015 17:19 — forked from mogsdad/GCalUtils.md
Collection of Google Calendar related utility functions for Google Apps Script.

Google Calendar Utilities

getEventsWithGuest

Gets all events that occur within a given time range, and that include the specified guest email in the guest list.

###Parameters:###

@marcusmoore
marcusmoore / install
Last active August 28, 2015 02:44
PHPUnit Install
wget https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
sudo mv phpunit.phar /usr/local/bin/phpunit
phpunit --version