Skip to content

Instantly share code, notes, and snippets.

View kevinruscoe's full-sized avatar
💻
Working

Kevin Ruscoe kevinruscoe

💻
Working
View GitHub Profile
@kevinruscoe
kevinruscoe / .htaccess
Last active December 23, 2015 21:29
Use Mod_Deflate to compress HTTP request
<FilesMatch "\\.(js|css|html|htm|php|xml)$">
SetOutputFilter DEFLATE
</FilesMatch>
@kevinruscoe
kevinruscoe / new-database-with-user.sql
Last active December 30, 2015 03:49
How to create a MySQL user and assign it to a databases.
# ~1~ = Datbase Name
# ~2~ = New MySQL username
# ~3~ = The new users password
# Create a database
CREATE DATABASE `~1~`;
# Create a user
CREATE USER '~2~'@'localhost' IDENTIFIED BY '~3~';
@kevinruscoe
kevinruscoe / gist:10109022
Created April 8, 2014 10:49
Add GZIP Compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</IfModule>
@kevinruscoe
kevinruscoe / gist:11395094
Last active August 29, 2015 14:00
Breadcrumb functions for WordPress
<?php
function the_breadcrumb(){
echo get_breadcrumb();
}
function get_breadcrumb(){
global $post;
$posts = array();
@kevinruscoe
kevinruscoe / microdata-review.html
Last active August 29, 2015 14:00
microdata rating/review
<!-- The Review, this <div> is repeatable for more than 1 review -->
<div itemprop="review" itemscope itemtype="http://schema.org/Review">
<h1 itemprop="about">This thing is brilliant!</h1>
<p><span itemprop="author">Kevin Ruscoe</span>'s review of <span property="v:itemreviewed">this thing</span> - <span itemprop="datePublished" content="2014-05-02">May 2nd 2014</span>
<p itemprop="reviewBody">
This thing is question is awesome. It does so many things!
</p>
<div itemscope itemtype="http://schema.org/Dentist">
<h1 itemprop="name">Practice Name</h1>
<p itemprop="address" itemscope itemtype="http://schema.org/PostalAddress">
<span itemprop="streetAddress">Practice Address</span>
<span itemprop="addressLocality">Practice City</span>,
<span itemprop="addressRegion">Practice State/County</span>
<span itemprop="postalCode">Practice ZIP/Postcode</span>
</p>
<p>
Phone: <span itemprop="telephone">00000 000 000</span>
@kevinruscoe
kevinruscoe / seo-site-move
Created May 16, 2014 10:04
SEO site move.
1 - Head over to Google Webmasters and add the old site
2 - Submit a sitemap for the old site
3 - Create 301 redirects to new site from old site (make pages-to-redirects, i.e. domain1.com/news - domain2.com/our-news)
4 - Add new site to Webmasters
5 - Submit a sitemap for the new site
6 - Crawl/fetch as Google on new site
7 - Crawl/fetch as Google on old site
8 - In the old sites webmaster tools, click the cog icon, and click "change of address".
@kevinruscoe
kevinruscoe / wordpress-cheats.md
Last active August 29, 2015 14:01
WordPress Cheats

Blog Details

<p>
  <small>Posted by <strong><?php the_author() ?></strong> on <?php the_time('jS F Y') ?>, under <?php the_category(',') ?></small>
</p>

Only show 300 chars of blog

@kevinruscoe
kevinruscoe / gist:78fd1869b08b5d04d5a9
Created June 30, 2014 11:58
A simple trade system for UFPS
using UnityEngine;
using System.Collections;
public class SimpleTrade : MonoBehaviour {
public vp_Inventory inventory;
public vp_UnitType required_item;
public vp_ItemType given_item;
void OnTriggerEnter( Collider col ){
@kevinruscoe
kevinruscoe / ConditionedWeapon.cs
Last active August 29, 2015 14:03
Conditioned Weapon for UFPS
using UnityEngine;
using System.Collections;
public class ConditionedWeapon : MonoBehaviour {
private vp_FPPlayerEventHandler m_Player;
public float condition = 1f; // Item's condition ( 0% to 100% )
public float useDamage = .5f; // Each use removes x% off the condition