View .bash_profile
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\$(parse_git_branch)\[\033[m\]\$ "
View git-deploy.bash
#!/bin/bash
read -r -p 'Commit message: ' ${desc} # prompt user for commit message
git add . # track all files
git add -u # track all deleted files
git commit -m "$desc" # commit with message
git push origin master # push to origin
git push production master # push to development server
View fetch.js
fetch('./js/data.json').then(response => {
return response.json();
}).then(data => {
console.log(data);
}).catch(err => {});
View memory-0.1.js
const cardsArray = [ /* ... */ ];
const game = document.getElementById('game');
const grid = document.createElement('section');
grid.setAttribute('class', 'grid');
game.appendChild(grid);
cardsArray.forEach(item => {
const card = document.createElement('div');
card.classList.add('card');
View triangle.css
i {
border: solid black;
border-width: 0 3px 3px 0;
display: inline-block;
padding: 3px;
transform: rotate(45deg);
}
View php-pdo-mysql-crud.md

Basic CRUD operations with PDO

CRUD = Create, Read, Update, Delete

Open a database connection

$host = '127.0.0.1';
$dbname = 'test';
$username = 'root';
View functions.php
//Forged Settings
function forged_settings_add_options(){
add_options_page( 'Forged Settings', 'Forged Settings', 'manage_options', 'forged-settings', 'forged_settings_page');
}
add_action( 'admin_menu', 'forged_settings_add_options');
//Create Forged Settings Submenu
function forged_settings_page(){ ?>
<div class = "wrap">
<h1>Forged Theme Settings</h1>
View osx_setup.md

Mac OSX Bootstrap

Upgrade to Mavericks

  1. Install Mavericks via the App Store.

Secure The Machine

View page.php
<?php get_header(); ?>
<?php
$args = array(
'post_type' => 'your_post',
);
$your_loop = new WP_Query( $args ); if ( $your_loop->have_posts() ) : while ( $your_loop->have_posts() ) : $your_loop->the_post();
$meta = get_post_meta( $post->ID, 'your_fields', true ); ?>
View functions.php
<?php
function create_post_your_post() {
register_post_type( 'your_post',
array(
'labels' => array(
'name' => __( 'Your Post' ),
),
'public' => true,
'hierarchical' => true,