Skip to content

Instantly share code, notes, and snippets.

View ericlbarnes's full-sized avatar
🎵
git push it, git push it real good

Eric Barnes ericlbarnes

🎵
git push it, git push it real good
View GitHub Profile
@ericlbarnes
ericlbarnes / wordpress.dev
Created February 27, 2015 16:07
WordPress Homestead Nginx
server {
listen 80;
server_name wordpress.app;
root "/home/vagrant/Code/wordpress";
index index.html index.htm index.php;
charset utf-8;
location / {
@ericlbarnes
ericlbarnes / gistlog.md
Created February 19, 2015 01:55
Create your own blog with Gistlog

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

@ericlbarnes
ericlbarnes / post.md
Created February 19, 2015 01:44
Use Laravel Blade And AngularJS Together

By default AngularJS and Blade conflict with the way variables are called. Both use a double curly bracket {{ var }} syntax. There are a few workarounds such as changing Angular’s or Blade’s delimiters but an easier method is available.

Inside blade prefix Angular echo variables with the at “@“ symbol. Here is an example:

<li ng-repeat="phone in phones | filter:query | orderBy:orderProp">
    <span>@{{phone.name}}</span>
    <p>@{{phone.snippet}}</p>
</li>
<div class="button">
<a href="#" onClick="doThing()">CLICK ME</a>
<script src="javascript">
function doThing() {
//...
}
</script>
</div>
@ericlbarnes
ericlbarnes / countries.php
Created January 26, 2015 20:11 — forked from DHS/PHP Countries Array
PHP Array of country names
<?php
return [
"Afghanistan",
"Albania",
"Algeria",
"Andorra",
"Angola",
"Antigua and Barbuda",
"Argentina",
@ericlbarnes
ericlbarnes / .bowerrc
Created January 17, 2015 03:33
Laravel Elixir With Bootstrap Sass
{
"directory": "vendor/bower_components"
}
@ericlbarnes
ericlbarnes / wordress-word-count.php
Created December 22, 2014 15:03
Count the total words of all posts for the year
<?php
$words = 0;
$posts = query_posts([
'posts_per_page' => -1,
'year' => '2014',
]);
foreach ($posts as $post) {
$words += str_word_count($post->post_content);
<?php
if (file_exists(dirname(__FILE__) . '/wp-config-local.php')) {
# IMPORTANT: ensure your local config does not include wp-settings.php
require_once(dirname(__FILE__) . '/wp-config-local.php');
} else {
// Don't show deprecations; useful under PHP 5.5
error_reporting(E_ALL ^ E_DEPRECATED);
define('DB_NAME', getenv('DB_NAME') );
@ericlbarnes
ericlbarnes / angular.blade.php
Created December 11, 2014 05:16
Angular with Laravel Blade Sample
<li ng-repeat="phone in phones | filter:query | orderBy:orderProp">
<span>@{{phone.name}}</span>
<p>@{{phone.snippet}}</p>
</li>