Skip to content

Instantly share code, notes, and snippets.

@trevorgreenleaf
trevorgreenleaf / gist:87e93263ba08f24f198e
Created February 6, 2015 17:55
GIT: Clear out all local branches that have been merged into dev
git checkout dev && git branch --merged dev | grep -v "\* dev" | grep -v "staging" | xargs -n 1 git branch -d
http://www.missiontolearn.com/2013/10/self-directed-learning-success/
1. Takes initiative
2. Is comfortable with independence
3. Is persistent
4. Accepts responsibility
5. Views problems as challenges, not obstacles
6. Is capable of self-discipline
7. Has a high degree of curiosity
8. Has a strong desire to learn or change
@trevorgreenleaf
trevorgreenleaf / gist:06f9ae4c40d773acb047
Created April 30, 2015 03:32
English / Spanish Document
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>English / Spanish Document</title>
<style>
.menu {
background-color: #ccc;
list-style: none;
}
@trevorgreenleaf
trevorgreenleaf / tagCleaner
Created July 6, 2015 19:54
PHP tagCleaner
/**
* Send it a string of words and it will return
* @return array of clean tags
*/
protected function tagCleaner($tags = null){
// make lowercase
$tags = strtolower($tags);
// remove the crap
$tags = str_replace([',', '|', '/', '.', '#'], '', $tags);
// explod string at space into tags
@trevorgreenleaf
trevorgreenleaf / hex2rgb
Created July 6, 2015 19:56
HEX to RGB PHP
/**
* @return an array of rgb values
*/
protected function hex2rgb($hex = null ){
return sscanf($hex, "#%02x%02x%02x");
}
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
}
/* Extra Small Devices, Phones */
@media only screen and (min-width : 480px) {
@trevorgreenleaf
trevorgreenleaf / Laravel Query Debug
Created July 10, 2015 04:03
Laravel Query Debug
DB::connection()->enableQueryLog();
$query = DB::getQueryLog();
$lastQuery = end($query);
dd($lastQuery);
@trevorgreenleaf
trevorgreenleaf / ssh
Created July 25, 2015 06:27
Copy SSH Key
pbcopy < ~/.ssh/id_rsa.pub
chown -R apache:apache filename
@trevorgreenleaf
trevorgreenleaf / scripts.js
Last active September 1, 2015 02:32
jQuery: Start Project
(function($) {
// Lets Begin :)
})(jQuery);