Skip to content

Instantly share code, notes, and snippets.

View SyntaxC4's full-sized avatar
🏠
Working from home

Cory Fowler SyntaxC4

🏠
Working from home
View GitHub Profile
@echo off
IF "%PROCESSOR_ARCHITECTURE%" == "x86" GOTO End
IF "%PROCESSOR_ARCHITECTURE%" == "AMD64" GOTO x64
:x64
sc config wuauserv start= demand
GOTO End
:End
namespace Net.SyntaxC4.Blog.Examples
{
using System;
using System.Linq.Expressions;
using System.Web.Mvc;
using System.Web.Mvc.Html;
using System.Web.Routing;
public static class HtmlExtensions
{
// Developer: Cory Fowler
// Company: SyntaxC4 Development Services
// Description: Adds Type Safety and Saves Memory over Class
namespace WageCalculator.Abstractions
{
public struct OvertimeRates
{
public const float Regular = 1.0f;
public const float Time_And_A_Half = 1.5f;
using System;
using System.Linq.Expressions;
using System.Text.RegularExpressions;
using System.Web.Mvc;
using System.Web.Mvc.Html;
public static class ValidationExtensions
{
public static MvcHtmlString ValidationMessageLabelFor<TModel, TProperty>(this HtmlHelper<TModel> html, Expression<Func<TModel, TProperty>> expression, string errorClass = "error")
{
@SyntaxC4
SyntaxC4 / wp-config.php
Created November 24, 2012 19:06
Custom WordPress WP-CONFIG.PHP MySQL section for use on Windows Azure Web Sites.
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', getenv('WP_DB_NAME'));
/** MySQL database username */
define('DB_USER', getenv('WP_DB_USER'));
/** MySQL database password */
define('DB_PASSWORD', getenv('WP_DB_PASSWORD'));
@SyntaxC4
SyntaxC4 / ServiceDefinition.csdef
Created September 29, 2012 05:19
Windows Azure Cloud Service or Web Site: Where am I Deployed?
<ServiceDefinition name="MyService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
<WebRole name="WebRole1">
<Runtime>
<Environment>
<Variable name="WhereAmI" value="cloud" />
</Environment>
</Runtime>
</WebRole>
</ServiceDefinition>
@SyntaxC4
SyntaxC4 / breakBlobLease.js
Last active December 16, 2016 19:26
This code snippet will help break Blob Leases in Windows Azure Storage.
/*
* This code snippet will help break Blob Leases in Windows Azure Storage.
*
* I did not write this code, it was found at the website below.
*
* @see http://blogs.msdn.com/b/interoperability/archive/2012/08/01/node-js-script-for-releasing-a-windows-azure-blob-lease.aspx
*/
// updated 3/3/2014 for latest version of Azure CLI
// Import required modules from Windows Azure Cross Platform Tool's library
@SyntaxC4
SyntaxC4 / array.php
Created August 29, 2012 10:05
PartitionKey or RowKey must satisfy is_string
array('1' => 'value1', '2' => 'value2');
### Check me into the root of the repo
### as .gitattributes
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
@SyntaxC4
SyntaxC4 / web.config
Created July 26, 2012 20:44
Setting up CakePHP on Windows Azure Web Sites
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />