Skip to content

Instantly share code, notes, and snippets.

View openam's full-sized avatar
💭
...

Michael Tuttle openam

💭
...
  • Vivint Solar
  • Utah, United States
View GitHub Profile
@openam
openam / Default (Linux).sublime-keymap
Created November 10, 2012 19:00 — forked from coldnebo/Default (Linux).sublime-keymap
simple scripts to prettify your xml and json in sublime text 2
[
{ "keys": ["ctrl+shift+x"], "command": "tidy_xml" },
{ "keys": ["ctrl+shift+j"], "command": "prettify_json" }
]
@openam
openam / bash_aliases.bash
Last active December 17, 2015 16:29
Bash Prompt
# Colors from https://wiki.archlinux.org/index.php/Color_Bash_Prompt
# Reset
Color_Off='\e[0m' # Text Reset
# Regular Colors
Black='\e[0;30m' # Black
Red='\e[0;31m' # Red
Green='\e[0;32m' # Green
Yellow='\e[0;33m' # Yellow
Blue='\e[0;34m' # Blue
@openam
openam / Base File.sublime-settings
Last active December 27, 2015 10:49
Sublime Text Settings Preferences: Settings - User Default (Linux): Key Bindings - User Package Control: Package Settings -> Package Control -> Settings - User Base File: Package Settings -> DocBlockr -> Settings - User
{
"jsdocs_align_tags": "no",
"jsdocs_spacer_between_sections": true
}
@openam
openam / pre-commit
Created January 13, 2014 19:22
a pre-commit hook to look for words commonly used for debugging in js, php, and ctp files.
#!/usr/bin/env bash
#
# A Git pre-commit hook that checks for discouraged words in
# in files based on the extensions of staged files in Git.
#
# Copyright 2014, openam (http://github.com/openam)
# http://www.davidpashley.com/articles/writing-robust-shell-scripts/
set -o nounset
set -o errexit
@openam
openam / rmkdir.php
Created February 26, 2014 17:19
Make Directories Recursively in PHP 4
<?php
/**
* rmkdir is a recursive mkdir function. PHP4 doesn't have the recursive paramater,
* so this was added to use on a PHP 4 server. These references could be changed back to
*
* @param string $path
* @param int $mode of the file permissions
* @param boolean $recursive not used, but is there so that you can easly change from rmkdir (PHP 4) to mkdir(PHP 5) easily
* @return boolean true if directories were successfully created
*/
@openam
openam / directoryIterator.php
Created February 26, 2014 17:22
Directory Iterator class for PHP 4
<?php
/**
* @category PHP4 DirectoryIterator class
* @version 0.0.1
* @author Adrian Rotea <adirotea@yahoo.com>
* @copyright Copyright © 2005, Adrian Rotea <adirotea@yahoo.com>
* @link http://www.weberdev.com/get_example.php3?ExampleID=4180
*
* This class implements the SPL DirectoryIterator in PHP4.
* Very usefull if wanting to traverse directories in an OO style
@openam
openam / debug.php
Created February 26, 2014 17:25
A simple PHP debug function, similar to CakePHP
<?php
/**
* debug is a simple function to show which line and file a debug call came from
* including the contents of print_r() wrapped in a <pre> tag
*
* @param string $value
* @return void
*/
function debug($value = '') {
$backtrace = debug_backtrace();
@openam
openam / get_directories.php
Created February 26, 2014 17:27
Returns a list of sub-directories given a starting path. Uses DirectoryIterator class.
<?php
/**
* get_directories description
*
* @param string $path the path to start from
* @param string $regex that the directories must match, use empty string '' for all
* @return array of directories in the path
*/
function get_directories($path = '.', $regex = '') {
$list = array();
@openam
openam / less.sh
Created April 28, 2014 16:38
Compile Less with Source Map
#!/bin/sh
lessc css/styles.less > css/styles.css --source-map=css/styles.css.map --source-map-basepath=css/
NOW=$(date)
echo "Recompiling less completed $NOW"

Setup

General

# setup and install protractor for testing
npm install -g protractor
npm install -g karma-cli
webdriver-manager update

# prepare local application