I hereby claim:
- I am omurphy27 on github.
- I am omurphy27 (https://keybase.io/omurphy27) on keybase.
- I have a public key ASDuCIq83t_gNRhggBHQky1IXF_bTrJZkk8tuJHvapz1BAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
/** | |
* Helper functions to make formatting the date easier | |
*/ | |
Date.prototype.getMonthNameShort = function() { | |
return Date.month_names_short[ this.getMonth() ]; | |
}; | |
Date.month_names_short = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; | |
Date.prototype.getDateEnding = function() { |
<?php | |
$terms = get_terms( array( | |
'taxonomy' => 'dojo_category', | |
) ); | |
foreach( $terms as $term ) : ?> | |
<div class="dojo-location-block"> | |
<h2><?php echo $term->name; ?></h2> | |
<?php $posts = new WP_Query( "taxonomy=dojo_category&term=$term->slug&posts_per_page=-1" ); | |
if( $posts->have_posts() ): while( $posts->have_posts() ) : $posts->the_post(); ?> | |
<div class="dojo-block clearfix"> |
{ | |
"name": "generic-project", | |
"version": "1.0.0", | |
"main": "gulpfile.js", | |
"license": "ISC", | |
"devDependencies": { | |
"gulp": "^3.9.1", | |
"gulp-autoprefixer": "^3.1.1", | |
"gulp-clean-css": "^2.0.12", | |
"gulp-concat": "^2.6.1", |
/node_modules | |
/public/storage | |
/vendor | |
/laradock | |
/.idea | |
Homestead.json | |
Homestead.yaml | |
.env | |
*.swp | |
*.swn |
<?php | |
// in the routes/web.php file | |
// the auto generated 'Auth::routes()' | |
// creates the below routes | |
// Authentication Routes... | |
Route::get('login', 'Auth\LoginController@showLoginForm')->name('login'); | |
Route::post('login', 'Auth\LoginController@login'); | |
Route::post('logout', 'Auth\LoginController@logout')->name('logout'); |
<?php | |
// must first define the relationships between your models | |
// see here: https://laravel.com/docs/5.3/eloquent-relationships#eager-loading | |
$result = Topic::where( 'slug', $slug )->approved()->with([ | |
'comments' => function( $query ) use ( $data ) { | |
$query->take( $data['limit'] ) | |
->skip( $data['limit'] * ( $data['page'] - 1 ) ) | |
->with('user.profile') |
<?php | |
$result = Model::where(...)->get(); | |
if ($result->first()) { } | |
if (!$result->isEmpty()) { } | |
if ($result->count()) { } | |
if (count($result)) { } | |
// see here: http://stackoverflow.com/questions/20563166/eloquent-collection-counting-and-detect-empty |
<?php | |
// add the below to your functions file | |
// then visit the page that you want to see | |
// the enqueued scripts and stylesheets for | |
function se_inspect_styles() { | |
global $wp_styles; | |
echo "<h2>Enqueued CSS Stylesheets</h2><ul>"; | |
foreach( $wp_styles->queue as $handle ) : | |
echo "<li>" . $handle . "</li>"; |
# add any other filename endings you wish to exclude | |
function mygrep { | |
grep -inrF "$1" --exclude-dir={node_modules,vendor,.git,.svn} --exclude=\*.{min.js,min.css,map,swp,swn,swo} . --color; | |
} | |
# fire the above function in your terminal by doing the below | |
# in the directory you wish to recursively grep through | |
mygrep function_name_to_grep | |
# or wrap your search term in quotes |