Skip to content

Instantly share code, notes, and snippets.

View dotsonjb14's full-sized avatar

Joseph Dotson dotsonjb14

View GitHub Profile
$test = new DOTMailer()
@dotsonjb14
dotsonjb14 / html version
Created April 23, 2012 04:56
freedns webclude standard html
<!-- begin freedns banner code -->
<div style="width:468px;margin:0 auto;">
<form onclick="window.open(this.href); return false;" action="http://freedns.afraid.org/subdomain/edit.php">
<table style="border-style=solid;border-width=1;border-color=black;width:468px;height:60px;background-color:#ccc"><tr><td align="center">
<table border="0" cellpadding="2" cellspacing="0">
<tr><td align="center" colspan="3"><div style="font-family: Verdana, Helvetica;font-size: 13px;color: black;hover: orange;"><a onclick="window.open(this.href); return false;" style="font-family: Verdana, Helvetica;font-size: 13px;color: black;hover: orange;" href="http://freedns.afraid.org/">Free DNS</a> provides easy shared DNS hosting &amp; URL forwarding</div></td></tr>
<tr>
<td align="center" valign="middle"><input type="text" size="15" name="subdomain" value="yourname" /></td>
@dotsonjb14
dotsonjb14 / gist:3007742
Created June 28, 2012 00:04
get_tags, check for empty term
public function get_tags()
{
$this->theme->wsse = Utils::WSSE();
$this->theme->tags = Tags::vocabulary()->get_tree( 'term_display asc' );
$this->theme->max = Tags::vocabulary()->max_count();
for( $i = 0; $i < count($this->theme->tags); $i++ )
{
if( $this->theme->tags[$i]->term_display == "" )
#include <iostream>
int f(int num)
{
if(num > 0)
return 0 - num;
else
return num;
}
<?php
/*
$pages is an array of assoc arrays containing all of the menu items
$id is the page to be moved
$matches[2] is the direction
*/
$len = count($pages);
for ($i=0; $i < $len; $i++)
{
class test(object):
def __init__(self):
self.x = 23
{
"metadata": {
"name": "DnD"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
{
"metadata": {
"name": "DnD"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@dotsonjb14
dotsonjb14 / gist:edbc402cfa3e02e6f188
Last active August 29, 2015 14:15
Adventure Sales by Year
var salesPeople =
Person
.Select(x => new { Name = x.FirstName + " " + x.LastName, x.BusinessEntityID });
SalesOrderHeader
.Where(x => x.OnlineOrderFlag == false)
.GroupBy(x => new { x.OrderDate.Year, x.SalesPersonID })
.Select(x => new {
Key = x.Key,
Sales = x.Sum(y => y.SubTotal)
@dotsonjb14
dotsonjb14 / gist:7ed67b48f5d2fb4326bb
Last active August 29, 2015 14:15
Adventure Sales by Year
SELECT data.[Year], p.FirstName + ' ' + p.LastName, data.Amount FROM
(
SELECT DATEPART(Year, OrderDate) as [Year], SalesPersonID, SUM(subtotal) as Amount FROM
Sales.SalesOrderHeader
WHERE OnlineOrderFlag = 0
GROUP BY DATEPART(Year, OrderDate), SalesPersonID
) data
INNER JOIN Person.Person as [p] ON data.SalesPersonID = p.BusinessEntityID
ORDER BY [Year], Amount DESC