Skip to content

Instantly share code, notes, and snippets.

View BradSmithSC's full-sized avatar

Brad Smith BradSmithSC

  • SE Retail
  • Slater SC
View GitHub Profile
@stevebauman
stevebauman / Export.sql
Created December 17, 2018 21:47
Dynamics GP Export / Query User Security Roles
-- This can be used for GP 2010, GP 2013, GP 2015 and GP 2016.
use DYNAMICS;
SELECT
UserMaster.USRCLASS AS 'User Class',
UserMaster.USERID AS 'User ID',
UserMaster.USERNAME AS 'Username',
CASE UserMaster.UserStatus
WHEN 1 THEN
@rhynodesigns
rhynodesigns / index.php
Created June 17, 2016 20:35
UpstatePHP 101: Persistence
<?php
echo '<pre>';
echo '<br><br><br>';
$value = 10;
$value2 = '10';
var_dump($value == $value2); // true
echo '<br>';
<?php
$gameName = 'War';
class Deck
{
/** Assume cards are face down in deck
* Botom card is in position 0 in the array
*/
public $suits = ['S', 'H', 'C', 'D'];
@steveosoule
steveosoule / .htaccess
Created May 25, 2016 18:26
WP Super Cache .htaccess
# BEGIN WordPress - WP Super Cache
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_METHOD} !=POST
RewriteCond %{QUERY_STRING} !.*=.*
RewriteCond %{HTTP_COOKIE} !^.*(comment_author_|wordpress|wp-postpass_).*$
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).*
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
<?php
$gameName = 'War';
class Deck
{
public $suits = ['S', 'H', 'C', 'D'];
public $indices = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];
protected $deck = [];
@joshuadavidnelson
joshuadavidnelson / create-image-id.php
Last active November 7, 2023 05:04
Programmatically create the image attachment and return the new media upload id.
<?php
/**
* Create the image attachment and return the new media upload id.
*
* @author Joshua David Nelson, josh@joshuadnelson.com
*
* @since 03.29.2017 updated to a class, utilizing code from Takuro Hishikawa's gist linked below.
*
* @see https://gist.github.com/hissy/7352933
*
@cdils
cdils / editor-style.php
Last active March 27, 2020 05:49
Apply theme's stylesheet to the visual editor.
add_action( 'init', 'cd_add_editor_styles' );
/**
* Apply theme's stylesheet to the visual editor.
*
* @uses add_editor_style() Links a stylesheet to visual editor
* @uses get_stylesheet_uri() Returns URI of theme stylesheet
*/
function cd_add_editor_styles() {
add_editor_style( get_stylesheet_uri() );
# BEGIN WPSuperCache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
AddDefaultCharset UTF-8
RewriteCond %{REQUEST_URI} !^.*[^/]$
RewriteCond %{REQUEST_URI} !^.*//.*$
RewriteCond %{REQUEST_METHOD} !POST