Skip to content

Instantly share code, notes, and snippets.

View joeygreen's full-sized avatar

Joey Green joeygreen

View GitHub Profile
var g = 'Galileo';
for (i = 0; i < 5; i++){
if (i % 2 == 0) { console.log(g.toUpperCase()); }
else { console.log(g.toLowerCase()); }
if (i == 4) { console.log("Figaro!"); }
};
console.log('Magnifico!');
public static string RenderViewToString(ControllerContext context, string viewName, object model)
{
if (string.IsNullOrEmpty(viewName))
viewName = context.RouteData.GetRequiredString("action");
ViewDataDictionary viewData = new ViewDataDictionary(model);
using (StringWriter sw = new StringWriter())
{
ViewEngineResult viewResult = ViewEngines.Engines.FindPartialView(context, viewName);
divRollup.InnerHtml = "<strong>Using Employee.Manager(s)</strong><br /><br />";
if (emp.Manager != null)
{
divRollup.InnerHtml += "1 - " + emp.Manager.EmployeeFullName + "<br />";
if (emp.Manager.Superior != null)
{
divRollup.InnerHtml += "2 - " + emp.Manager.Superior.FullName + "<br />";
if (emp.Manager.Superior.Superior != null)
public void Application_BeginRequest(Object sender, EventArgs e)
{
// Check url
if (Regex.IsMatch(HttpContext.Current.Request.Url.ToString(), @"[A-Z]") == true)
{
// Lowercase url
String lower = HttpContext.Current.Request.Url.ToString().ToLower();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Data.Linq;
using System.Text;
using NUnit.Framework;
using Sandow.LuxeSource.Models;
namespace Sandow.LuxeSource.Tests
{