Skip to content

Instantly share code, notes, and snippets.

View CFranc111's full-sized avatar

Chris Franchetti Michaels CFranc111

  • Novato, CA
  • 14:14 (UTC -07:00)
View GitHub Profile
@petertwise
petertwise / youtube-cover-art.php
Last active July 31, 2020 07:52
Get the best version of youtube cover image without using the API
<?php
function url_exists( $url ) {
$headers = get_headers($url);
return stripos( $headers[0], "200 OK" ) ? true : false;
}
function get_youtube_id( $url ) {
$youtubeid = explode('v=', $url);
$youtubeid = explode('&', $youtubeid[1]);
@victor-vargas2009
victor-vargas2009 / Ball.cs
Created February 1, 2016 03:06
Bloke Breaker
using UnityEngine;
using System.Collections;
public class Ball : MonoBehaviour {
private Paddle paddleObject;
private Vector3 paddleToBallVector;
private bool hasStarted = false;
// Use this for initialization
@victor-vargas2009
victor-vargas2009 / LoseCollider.cs
Created February 1, 2016 03:04
Block Breaker
using UnityEngine;
using System.Collections;
public class LoseCollider : MonoBehaviour {
public static int playerLives = 2;
private LevelManager lvlManager;
private LivesTextIndicatorUI uiLivesIndicator;
private Ball ball;
@gokulkrishh
gokulkrishh / media-query.css
Last active July 16, 2024 10:52
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@JiveDig
JiveDig / gist:5700466
Created June 3, 2013 19:03
Register The "Video Categories" and "Video Tags" Custom Taxonomies
// ------------------------------ Video Categories
if ( ! function_exists('jivedig_video_category_taxonomy') ) {
// Register Custom Taxonomy
function jivedig_video_category_taxonomy() {
$labels = array(
'name' => 'Video Categories',
'singular_name' => 'Video Category',
'menu_name' => 'Video Categories',
'all_items' => 'All Video Categories',
@JiveDig
JiveDig / gist:5700439
Last active July 19, 2019 23:49
Register videos custom post type
// Register 'videos' Post Type
if ( ! function_exists('jivedig_videos_post_type') ) {
function jivedig_videos_post_type() {
$labels = array(
'name' => _x( 'Videos', 'themename' ),
'singular_name' => _x( 'Video', 'themename' ),
'menu_name' => __( 'Videos', 'themename' ),
'parent_item_colon' => __( 'Parent Video:', 'themename' ),
'all_items' => __( 'All Videos', 'themename' ),
'view_item' => __( 'View Video', 'themename' ),
@DavidWells
DavidWells / add-wordpress-settings-page.php
Created January 28, 2013 05:59
WordPress :: Add Settings Page with All Fields
<?php
/*
Plugin Name: Homepage Settings for BigBang
Plugin URI: http://www.inboundnow.com/
Description: Adds additional functionality to the big bang theme.
Author: David Wells
Author URI: http://www.inboundnow.com
*/
// Specify Hooks/Filters
@dskaggs
dskaggs / gist:3788338
Created September 26, 2012 14:21
Using caching to improve your ColdFusion application's performance

As you write more and larger ColdFusion applications, you will start looking for ways to improve the performance of your applications. There are many ways to do this but one of the easiest is to use ColdFusion's caching mechanisms to reduce the amount of work your application has to do over and over. Caching simply refers to the idea that you create a piece of content or data once and hold it in application memory for some period of time. During that time frame, any part of your application that needs that content or data uses the copy that was previously generated rather than regenerating it.

ColdFusion has several different caching mechanisms built in, but they generally fall into two main categories--programmatic caching and application server caching.

##Programmmatic Caching This type of caching is controlled by your application code. You decide which parts of your application would benefit from being cached and use CFML tags and attributes to determine what content is cached and how long your applicati