Skip to content

Instantly share code, notes, and snippets.

View RavenHursT's full-sized avatar
💭
Currently Job Searching. Please reach out if you might have something!

Matthew Marcus RavenHursT

💭
Currently Job Searching. Please reach out if you might have something!
View GitHub Profile
@RavenHursT
RavenHursT / gist:6246341
Created August 16, 2013 00:55
Test question for Gumroad
<?php
// 1, 4, 6, 3, 2
function findPivot($arr, $checkIndex = NULL){
//if only one value is passed into array, that is the pivot point because nothing on the left == nothing on the right
if(count($arr) == 1) return 0;
$lastCheckIndex = count($arr) - 1;
if(
$checkIndex > $lastCheckIndex ||
@RavenHursT
RavenHursT / gist:8676833
Last active January 4, 2016 20:49
visit counters POST
{
"start": 1233456,
"end": 1234567
}
@RavenHursT
RavenHursT / gist:9336067
Created March 3, 2014 22:34
Bash alias for killing Grunt Server
alias gkill="sudo kill -9 `ps -a | grep 'bin/grunt' | awk '{print $1}'`"
@RavenHursT
RavenHursT / gist:9421802
Created March 7, 2014 22:48
Trying to merge subtree
$cd /path/to/projectA
$git subtree split --prefix=subDirA/subDirB/ --branch=split-branch
.
.
Created branch 'split-branch'
334e51707eb9115be61f8a5bd731e7093d26742c
$cd /path/to/projectB
$git merge /path/to/projectA split-branch master
fatal: Can merge only exactly one commit into empty head
$git merge /path/to/projectA 334e51707eb9115be61f8a5bd731e7093d26742c master
{
"id":1,
"name":"name 1",
"segments":[
{"type":"KEYWORDS", "values":["market", "automation"]},
{"type":"ZIPCODE", "values":["94086", "94087", "94067"]}
],
"newchange":123
}
@RavenHursT
RavenHursT / messagingService.js
Created April 7, 2014 00:12
AngularJs messaging service/directive
.directive('postMessage', ['$window', 'postMessageService', function($window, postMessageService) {
return {
restrict: 'A',
controller: function($scope, $attrs, postMessageService) {
$scope.$on('outgoingMessage', function(evt, payload, targetOrigin, responseCallback) {
// console.log('Caught Message:');
// console.log(payload);
if ($scope.sender) {
var message = {
status: 200,
@RavenHursT
RavenHursT / jquery directive example.js
Last active August 29, 2015 13:58
directive wrapper example
angular.module('angularDomEdit', []).directive('domEdit', function(){
return {
restrict: 'A',
scope: {
mouseOver: '&domEditMouseOver',
itemSelect: '&domEditItemSelect',
close: '&domEditClose',
elementClick: '&domEditElementClick',
overlayClick: '&domEditOverlayClick',
resize: '&domEditResize',
@RavenHursT
RavenHursT / .bash_profile
Last active April 9, 2018 18:21
Mac OSX .bash_profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@RavenHursT
RavenHursT / .bash_aliases
Last active April 6, 2018 19:41
.bash_aliases
alias cp='cp -iv' # Preferred 'cp' implementation
alias mv='mv -iv' # Preferred 'mv' implementation
alias mkdir='mkdir -pv' # Preferred 'mkdir' implementation
alias ll='ls -FGlAhp' # Preferred 'ls' implementation
alias less='less -FSRXc' # Preferred 'less' implementation
cd() { builtin cd "$@"; ll; } # Always list directory contents upon 'cd'
alias cd..='cd ../' # Go back 1 directory level (for fast typers)
alias ..='cd ../' # Go back 1 directory level
alias ...='cd ../../' # Go back 2 directory levels
alias .3='cd ../../../' # Go back 3 directory levels
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url('../fonts/opensans/opensans-light.woff') format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;