This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Collections.Generic; | |
| namespace FollowMyBuild.Web.Models.ViewModels.Portable { | |
| public class PortableRecursiveComment { | |
| public PortableRecursiveComment() { | |
| Comments = new List<PortableComment>(); | |
| } | |
| public int Id { get; set; } | |
| public IEnumerable<PortableComment> Comments { get; set; } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dates.OrderBy(date => date.Date).GroupBy(d => d.Date).Select(list => list.OrderByDescending(date => date.TimeOfDay)).SelectMany(x => x); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on :message, /(.*)/ do |m, text| | |
| url = "http://127.0.0.1:1337/?text=#{URI.escape(text)}" | |
| result = open(url).read | |
| m.reply "That's what she said!" if result == 'true' | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on :channel, /^#{self.nick} roll (\d*)d(\d+)($|[\+\-]\d+$)/ do |m, n, d, mod| | |
| total = 0; | |
| dice = n.to_i == 0 ? 1 : [n.to_i.abs, 10].min | |
| dice.times do | |
| result = (Random.new).rand(1..d.to_i.abs) | |
| m.reply "#{m.user.nick} rolls a #{result}" | |
| total += result | |
| end | |
| unless mod.to_i == 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using (var file = new System.IO.StreamReader(script)) { | |
| var fileContent = file.ReadToEnd(); | |
| if (scriptType == ScriptType.Stylesheet) { | |
| var fromUri = new Uri(context.Server.MapPath("~/")); | |
| var toUri = new Uri(new FileInfo(script).DirectoryName); | |
| var relativeUri = fromUri.MakeRelativeUri(toUri); | |
| fileContent = fileContent.Replace("url(", "url(/" + relativeUri.ToString() + "/"); | |
| } | |
| scriptbody.Append(fileContent); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @using RazorScriptManager | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>@ViewBag.Title</title> | |
| @Script.AddScript("~/Content/Site.css", ScriptType.Stylesheet) | |
| @Script.AddScript("~/Content/themes/base/jquery.ui.all.css", ScriptType.Stylesheet) | |
| @Script.OutputScript(ScriptType.Stylesheet) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var directionsService = new google.maps.DirectionsService(); | |
| var directionsDisplay; | |
| var map2; | |
| function loadGoogleMap() { | |
| directionsDisplay = new google.maps.DirectionsRenderer(); | |
| var myOptions = { | |
| zoom: 18, | |
| mapTypeId: google.maps.MapTypeId.ROADMAP, | |
| zoomControl: true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// <summary> | |
| /// Create String for Google Map based on Dealer | |
| /// </summary> | |
| /// <param name="latitude"></param> | |
| /// <param name="longitude"></param> | |
| private void DisplayDealerMap(double latitude, double longitude) { | |
| StringBuilder sbMap = new StringBuilder(); | |
| sbMap.AppendFormat(@" <script language=""javascript"" type=""text/javascript"">{0}", Environment.NewLine); | |
| sbMap.AppendFormat(@" //<![CDATA[{0}", Environment.NewLine); | |
| sbMap.AppendFormat(@" function loadGoogleMap(){0}", Environment.NewLine); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace System.Web.Mvc.Html { | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using System.Diagnostics.CodeAnalysis; | |
| using System.Globalization; | |
| using System.Linq; | |
| using System.Linq.Expressions; | |
| using System.Text; | |
| using System.Web; | |
| using System.Web.Mvc.Resources; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace App.Models { | |
| public class IPLocation { | |
| public string ZipPostalCode { get; set; } | |
| public double Latitude { get; set; } | |
| public double Longitude { get; set; } | |
| public string City { get; set; } | |
| public string RegionName { get; set; } | |
| } | |
| } |