Skip to content

Instantly share code, notes, and snippets.

View ibejohn818's full-sized avatar

John Hardy ibejohn818

  • GoDaddy Inc
  • Los Angeles, Ca
View GitHub Profile
@ibejohn818
ibejohn818 / .vimrc
Last active July 12, 2016 22:21
Auto compile less on save in VIM on Mac OS X
" Call Function When Saving *.less files
autocmd FileWritePost,BufWritePost *.less :call HandleLessToCSS()
" Function to handle less compile
function! HandleLessToCSS()
let cwd = expand('<afile>:p:h')
let name = expand('<afile>:t:r')
if(executable('less'))
cal system('less '.cwd.'/'.name.'.less &')
endif
endfunction
sudo dd if=/Users/johnhardy/Downloads/linuxmint-18-cinnamon-64bit.iso of=/dev/disk1 bs=1m
@ibejohn818
ibejohn818 / post-receive
Created July 19, 2016 03:40
Git Deploy Use-case
#!/usr/bin/env php
<?php
$in = fopen("php://stdin","r");
$line = fgets($in);
preg_match_all('/(.*)( )(.*)( )(.*)/',$line,$matches);
@ibejohn818
ibejohn818 / test.py
Last active July 22, 2016 04:22
TMUX Session Helper (python)
#!/usr/bin/env python
import sys
import os
import shlex
import pprint
from subprocess import *
def cmd(inp):
#!/usr/bin/env python
import sys
import os
import shlex
import pprint
import re
from subprocess import *
#!/usr/bin/env python
import sys
import os
import shlex
import pprint
import re
from subprocess import *
@ibejohn818
ibejohn818 / modal.js
Created October 23, 2016 05:16
Bootstrap 3 Modal Javascript Var
var modalHTML ='<div class="modal fade" tabindex="-1" role="dialog">'+
'<div class="modal-dialog" role="document">'+
'<div class="modal-content">'+
'<div class="modal-header">'+
'<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>'+
'<h4 class="modal-title">Modal title</h4>'+
'</div>'+
'<div class="modal-body">'+
'<p>One fine body&hellip;</p>'+
'</div>'+
@ibejohn818
ibejohn818 / ys.zsh-theme
Created January 7, 2017 23:29
Customized YS ZSH Theme without git for vagrant
# Clean, simple, compatible and meaningful.
# Tested on Linux, Unix and Windows under ANSI colors.
# It is recommended to use with a dark background.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
#
# Mar 2013 Yad Smood
local exit_code="%(?,,C:%{$fg[red]%}%?%{$reset_color%})"
@ibejohn818
ibejohn818 / mysql-dump-import-table.sh
Last active May 2, 2017 18:01
MySQL Dump & Import between two databases a single table at a time
#!/usr/bin/env bash
###EXAMPLE USAGE
#./mysql-dump-import-table.sh {OUTHOST:OPTIONAL-PORT} {OUTUSER} {OUTDB_NAME} {INHOST:OPTIONAL-PORT} {INUSER} {INDB_NAME}
#Export Vars
DB_host=$1
DB_user=$2
DB=$3
@ibejohn818
ibejohn818 / MT_WP_TOOLS
Last active June 8, 2017 15:58
Media Temple Wordpress PHP Utils
/***
* (mt) Media Temple
* PHP Tools for Wordpress migrations
*
*
*/
class MT_WP_TOOLS
{
private static $_wpDBConfig = false;