Skip to content

Instantly share code, notes, and snippets.

View ntotten's full-sized avatar

Nathan Totten ntotten

View GitHub Profile
@ntotten
ntotten / BundleConfig.cs
Last active December 13, 2015 22:49
Building Amazing Apps with the ASP.NET EmberJS Template
bundles.Add(new ScriptBundle("~/bundles/app").Include(
"~/Scripts/app/app.js",
"~/Scripts/app/router.js",
"~/Scripts/app/helpers.js")
.IncludeDirectory("~/Scripts/app/routes", "*.js")
.IncludeDirectory("~/Scripts/app/models", "*.js")
.IncludeDirectory("~/Scripts/app/views", "*.js")
.IncludeDirectory("~/Scripts/app/controllers", "*.js"));
@ntotten
ntotten / appcodelocalMageCoreModelConfig.php
Created February 5, 2013 23:54
Magento on Rackspace Cloud Sites
$secure = (!empty($_SERVER['HTTPS']) && ($_SERVER['HTTPS']!='off')) || $_SERVER['SERVER_PORT']=='443';
@ntotten
ntotten / index.html
Created February 5, 2013 23:48
Photo Box Rotator
<ul id="panes" class="blockpix">
<li class="onehunpic">
<img src="<%=Url.Content("~/content/images/splash/0.jpg") %>" />
</li>
<li class="onehunpic">
<img src="<%=Url.Content("~/content/images/splash/1.jpg") %>" />
</li>
<li class="onehunpic whitesq"></li>
<li class="onehunpic whitesq"></li>
<li class="onehunpic">
@ntotten
ntotten / Program.cs
Created February 5, 2013 23:45
Google Apps Account Renaming Tool
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Google.GData.Apps;
namespace AtlasBay.GoogleAppsTools
{
class Program
{
@ntotten
ntotten / ConnectService.cs
Last active December 12, 2015 04:59
New Facebook Connect in C#
public class ConnectService : IConnectService {
readonly string appId;
readonly string appSecret;
FacebookCookie cookie = null;
public ConnectService() {
appId = ConfigurationManager.AppSettings[&quot;FacebookAppId&quot;];
appSecret = ConfigurationManager.AppSettings[&quot;FacebookAppSecret&quot;];
}
@ntotten
ntotten / Api.cs
Last active December 12, 2015 04:59
Dynamic objects and the Facebook C# SDK
Api api = new Api(session);
var user = api.Users.GetInfo(4);
string firstName = user.first_name;
string lastName = user.last_name;
string email = user.email;
var likes = api.Users.GetLikes(4);
foreach (var like in likes) {
string name = like.name;
}
@ntotten
ntotten / StaticContent.cs.html
Last active December 12, 2015 04:59
MVC Extension Method for Hosting Static Content on a CDN
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title</title>
<link href="@Url.StaticContent("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<script src="@Url.StaticContent("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
<script src="@Url.StaticContent("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
</head>
<body>
@ntotten
ntotten / CachedList.cs
Last active December 12, 2015 04:59
Caching Data in ASP.NET Applications
public static List cachedList = new List() {
new MyCachedThing() { Name = "Something" },
new MyCachedThing() { Name = "Another"}
};
@ntotten
ntotten / Create.cs
Last active December 15, 2016 08:44
Windows Azure Table Storage Tip
var account = CloudStorageAccount.FromConfigurationSetting("DataConnectionString");
CloudTableClient.CreateTablesFromModel(
typeof(TableServiceContext),
account.TableEndpoint.AbsoluteUri,
account.Credentials);
@ntotten
ntotten / Page.cs.html
Last active December 12, 2015 04:59
Windows Azure CDN Helpers
@ViewBag.Title
<script type="text/javascript" src="@Url.CdnContent("/Scripts/jquery-1.5.1.min.js")"></script>
<script type="text/javascript" src="@Url.CdnCombinedJs("core")"></script>