Skip to content

Instantly share code, notes, and snippets.

@devfred
devfred / gist:003877918a616b8c6ee9
Created June 22, 2015 19:55
Audio/Video-web.config
<staticContent>
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
<mimeMap fileExtension=".m4v" mimeType="video/m4v" />
<mimeMap fileExtension=".ogg" mimeType="video/ogg" />
<mimeMap fileExtension=".ogv" mimeType="video/ogg" />
<mimeMap fileExtension=".webm" mimeType="video/webm" />
<mimeMap fileExtension=".oga" mimeType="audio/ogg" />
<mimeMap fileExtension=".spx" mimeType="audio/ogg" />

Install Laravel 5 through Composer

First install Composer, then:

$ composer create-project laravel/laravel <project-name>

After that we can start a webserver, and test the default index page:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Responsive Design Testing</title>
<style>
body { margin: 20px; font-family: sans-serif; overflow-x: scroll; }
.wrapper { width: 6000px; }
.frame { float: left; }
h2 { margin: 0 0 5px 0; }
@devfred
devfred / ICallbackEventHandlerExample.cs
Last active August 29, 2015 14:05
csharp: ICallbackEventHandlerExample
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace CreativeWizardry.Controls
{
/// <summary>
/// Description of ICallbackEventHandlerExample.
/// </summary>
@devfred
devfred / SP_Definition.sql
Last active August 29, 2015 14:03
T-SQL: View the Definition of a Stored Procedure
EXEC sp_helptext N'SP NAME HERE';
@devfred
devfred / CallbackCheck.js
Created May 23, 2014 19:29
Javascript: Check if callback exists and is function
if (cb && (typeof cb == "function")) {
cb();
}
@devfred
devfred / HomeModule.cs
Created April 22, 2014 17:52
csharp: Poor mans webapi like routing in NancyFX
using System.Linq;
using Nancy;
using System;
using System.Reflection;
namespace CreativeWizardry.Owin.Core
{
public static class ExtensionMethods
{
@devfred
devfred / nancy.web.config
Created April 20, 2014 10:04
Xml: Nancy + Signalr web.config - Extensionless urls, assembly bindings, razor views, static assets handles by Nancy. Net4.5 required.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
<appSettings>
<add key="webPages:Enabled" value="false" />
</appSettings>
@devfred
devfred / Bootstrapper.cs
Last active August 29, 2015 14:00
csharp: Load views as embedded resources in Nancy
using System;
using Nancy;
using Nancy.Bootstrapper;
using Nancy.Diagnostics;
using Nancy.TinyIoc;
using Nancy.ViewEngines;
namespace CreativeWizardry.Owin.Core
{
/// <summary>
@devfred
devfred / IIS-ReWrite-Remove-ASPX.xml
Created April 15, 2014 15:02 — forked from jsheely/IIS-ReWrite-Remove-ASPX.xml
IIS-ReWrite-Remove-ASPX.xml
<rule name="san aspx">
<!--Removes the .aspx extension for all pages.-->
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="{R:1}.aspx" />
</rule>