Skip to content

Instantly share code, notes, and snippets.

View mavieth's full-sized avatar

Michael Vieth mavieth

  • Denver, CO
View GitHub Profile
@mavieth
mavieth / media-query-template.css
Last active April 18, 2024 21:53
Media Query Template for Basic CSS
/**
* Basic CSS Media Query Template
* TODO: I should probably use Sass...
* Author: Michael Vieth
* ------------------------------------------
* Responsive Grid Media Queries - 1280, 1024, 768, 480
* 1280-1024 - desktop (default grid)
* 1024-768 - tablet landscape
* 768-480 - tablet
* 480-less - phone landscape & smaller
<?php
/**
* Template Name: Sort User Table Page
*
* @package WordPress
*/
get_header();?>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.10/css/jquery.dataTables.min.css">
<?php
// Misc Functions
// Function that outputs the contents of the dashboard widget
function dash_widget( $post, $callback_args ) {
$posts_array = get_posts(
array(
'post_type' => 'post',
'orderby' => 'post_date',
'posts_per_page' => -1
<?php
/*
Plugin Name: Clock Spring
Plugin URI:
Description:
Author:
Version: 1.0
Author URI:
*/
function get_general_users(){
// WP_User_Query arguments
$args = array (
'orderby' => 'id',
'meta_key' => 'trainer_id',
'meta_value' => '',
'meta_compare' => '!=',
'order' => 'DESC'
);
$blogusers = get_general_users();
$arr = array();
foreach ( $blogusers as $user ) {
$meta = get_user_meta($user->ID);
$link = get_edit_user_link( $user->ID);
$editUserLink = '<a href=' .$link. '>Edit User Profile</a>';
$profileArray =array(
"Display Name" => $user->display_name,
"Email Address" => $user->user_email,
function rss_blog(){ ?>
<h2><?php _e( 'PTRC via Yahoo Finanace:', 'my-text-domain' ); ?></h2>
<?php // Get RSS Feed(s)
include_once( ABSPATH . WPINC . '/feed.php' );
// Get a SimplePie feed object from the specified feed source.
$rss = fetch_feed( 'http://feeds.finance.yahoo.com/rss/2.0/headline?s=PTRC&region=US&lang=en-US' );
if ( ! is_wp_error( $rss ) ) : // Checks that the object is created correctly
@mavieth
mavieth / Wordpress-Archive-By-Year.php
Created January 13, 2016 20:12
Wordpress-Archive-By-Year
Page Template
<?php
/**
* Template Name: Press By Year
*/
get_header(); ?>
<div id="content-full" class="grid col-940">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>
(function($) {
function getStock(opts, type, complete) {
var defs = {
desc: false,
baseURL: 'http://query.yahooapis.com/v1/public/yql?q=',
query: {
quotes: 'select * from yahoo.finance.quotes where symbol = "{stock}" | sort(field="{sortBy}", descending="{desc}")',
historicaldata: 'select * from yahoo.finance.historicaldata where symbol = "{stock}" and startDate = "{startDate}" and endDate = "{endDate}"'
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
/* This function is called when the module is loaded. */
int simple init(void){
printk(KERN INFO "Loading Module\n"); return 0;
}
/* This function is called when the module is removed. */