Skip to content

Instantly share code, notes, and snippets.

View ZachMoreno's full-sized avatar

Zachariah Moreno ZachMoreno

View GitHub Profile
/* The Magic Float Center Code */
.float_center {
float: right;
position: relative;
left: -50%; /* or right 50% */
text-align: left;
}
.float_center > .child {
position: relative;
/*=============================================
Grid
http://css-tricks.com/dont-overthink-it-grids/
=============================================*/
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
<ul>
<?php
$topThreePostsArgs = array(
'post_type' => 'coastal_news'
);
// Query the Coastal News post type -->
$my_query = new WP_Query( $topThreePostsArgs );
// While there are Coastal News items, loop through them as list items
while ($my_query->have_posts()) : $my_query->the_post();
// Don't show duplicates
@ZachMoreno
ZachMoreno / static-material.html
Created July 21, 2014 17:20
Google's Material Design in static form
<!doctype html>
<html>
<head>
<title>Zach Moreno Beta</title>
<!-- web fonts -->
<link href='http://fonts.googleapis.com/css?family=Roboto:400,100,300,500,700,400italic,300italic,100italic,500italic' rel='stylesheet' type='text/css'>
<!-- css -->
<link rel="stylesheet" type="text/css" href="style.css">
@ZachMoreno
ZachMoreno / controller-example.js
Created July 28, 2014 14:11
Consume JSON endpoint with Angular Service/Factory & promises
'use strict';
/* Controllers */
angular.module('zm.controllers', [])
.controller('homeCtrl', ['$scope', function($scope) {
}])
.controller('journalCtrl', ['$scope', 'recentPostsFactory', function($scope, recentPostsFactory) {
'use strict';
angular.module('appName.itemService', [])
.factory('Items', ['$resource', function($resource) {
return $resource('http://localhost:1337/api/v1/items/:id', {}, {
delete: {method: 'DELETE'}
});
}]);
// forEach method, could be shipped as part of an Object Literal/Module
var forEach = function (array, callback, scope) {
for (var i = 0; i < array.length; i++) {
callback.call(scope, i, array[i]); // passes back stuff we need
}
};
// language-toggle
var activateEnglish = function () {
<!doctype html>
<html>
<head></head>
<body>
<ol ng-repeat="day in root">
<li>{{ day.name }}
<ol ng-repeat="category in day.categories">
<li>{{ category.name }}
@ZachMoreno
ZachMoreno / scroll-to-top-example.html
Created December 4, 2014 16:15
depends on jquery & animate.css
<!doctype html>
<html>
<head>
<title></title>
<style>
/* fab */
.fab {
height: 56px;
width: 56px;
@ZachMoreno
ZachMoreno / js-library-scaffold.js
Last active August 29, 2015 14:13
JS Library Scaffold
var LibraryName = (function () {
var LibraryName = function LibraryName() {
}
// Todd Moto's forEach method
LibraryName.forEach = function forEach(array, callback, scope) {
for (var i = 0; i < array.length; i++) {
callback.call(scope, i, array[i]); // passes back stuff we need
}