Skip to content

Instantly share code, notes, and snippets.

View alexcurtis's full-sized avatar

Alex Curtis alexcurtis

View GitHub Profile
@alexcurtis
alexcurtis / gist:049dd811dd1c8dbceb3f
Created October 27, 2015 17:16
Pencilblue plugin Install Issue -- Silly Log
2015-10-27T17:13:16.710Z - silly: [1] New Request: 40d06ace-2082-41b8-99d4-772f288cff21
2015-10-27T17:13:16.712Z - silly: [1] RequestHandler: Session ID [e3a3b429-461b-423e-a9ec-35a333fcd9af] Cookie SID [undefined] Created [false] Expired [true]
2015-10-27T17:13:16.712Z - silly: [1] RequestHandler: Comparing Path [/api/plugins/install/wp_import] to Pattern [^/media/.*[/]{0,1}$] Result [false]
2015-10-27T17:13:16.712Z - silly: [1] RequestHandler: Comparing Path [/api/plugins/install/wp_import] to Pattern [^/public/[^/]+/.*[/]{0,1}$] Result [false]
2015-10-27T17:13:16.713Z - silly: [1] RequestHandler: Comparing Path [/api/plugins/install/wp_import] to Pattern [^/preview/[^/]+/[^/]+[/]{0,1}$] Result [false]
2015-10-27T17:13:16.713Z - silly: [1] RequestHandler: Comparing Path [/api/plugins/install/wp_import] to Pattern [^/section/[^/]+[/]{0,1}$] Result [false]
2015-10-27T17:13:16.713Z - silly: [1] RequestHandler: Comparing Path [/api/plugins/install/wp_import] to Pattern [^/article/[^/]+[/]{0,1}$] Result [false]
@alexcurtis
alexcurtis / gist:5029103
Last active December 14, 2015 04:38
MVC Cache Busted Resources
@*CSS*@
@ViewComponentHelper.RenderStyles(new[]
{
"/Content/site.css",
"/Content/bootstrap.css"
})
@*Javascript*@
@ViewComponentHelper.RenderScripts(new[]
{
@alexcurtis
alexcurtis / cache.xml
Created February 25, 2013 10:48
MVC Cache Busting Configuration
<appSettings>
<!-- Resource Cache Buster (Query String Postfix) -->
<add key="CacheComponentVersion" value="1" />
</appSettings>
@alexcurtis
alexcurtis / ViewComponentHelper.cs
Created February 25, 2013 10:47
MVC Scripts + Styles With Cache Buster
public static class ViewComponentHelper
{
private static string _cacheComponentVersion;
public static IHtmlString RenderScripts(string[] paths)
{
//Bust The Cache.
var bustedPaths = paths.Select(BustPath).ToArray();
return Scripts.Render(bustedPaths);
}
@alexcurtis
alexcurtis / Services.js
Created February 23, 2013 13:17
Before JQuery Promises Refactoring
//Get Services For id
function GetServices(id) {
//Get Popular Services
var popularServiceUrl = PopularServiceUrl(id);
$.getJSON(popularServiceUrl, {}, function (data) {
var pservices = {};
var services = {};
@alexcurtis
alexcurtis / ServicesRefactored.js
Last active December 13, 2015 18:08
Refactoring with JQuery Promises
function GetPopularServices(id) {
var d = $.Deferred();
var popularServiceUrl = PopularServiceUrl(id);
$.getJSON(popularServiceUrl, {}, function (data) {
CreatePopularService(this, function(service) {
//...
//Resolve The Promise
d.resolve({ services: [service] });
});
}).error(function () { ShowErrorDialog(); });
@alexcurtis
alexcurtis / gist:4648671
Created January 27, 2013 14:44
Heroku Releases
bash-3.2$ heroku releases
=== app Releases
v32 Deploy 9f6da49 **** 1h ago
v31 Deploy 0942632 **** 15h ago
v30 Deploy d98ffb3 **** 15h ago
v29 Deploy 613c33d **** 15h ago
...
@alexcurtis
alexcurtis / version.jade
Created January 27, 2013 14:35
Web App. Jade Version Variable
- var version = '0';
@alexcurtis
alexcurtis / deploy.sh
Created January 27, 2013 13:50
Heroku versioning on a Node.js project with Jade.
#!/bin/bash
#Update Version Number
version=$((`heroku releases | sed -n 2p | awk '{print substr($1,2); }'` + 1))
echo Updating JADE Version Number...
sed "s/'.*'/'$version'/" ./views/version.jade > version.tmp
mv version.tmp ./views/version.jade
#Deploy
@alexcurtis
alexcurtis / NodeGraph.xaml
Created December 6, 2012 12:12
WPF Node Graph Custom Controls
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Controls="clr-namespace:WpfNodeGraph.GraphEngine.Controls">
<!-- Node-->
<Style TargetType="{x:Type Controls:Node}">
</Style>
<!-- Hook-->
<Style TargetType="{x:Type Controls:Hook}">