Skip to content

Instantly share code, notes, and snippets.

@goenning
goenning / gist:1486368
Created December 16, 2011 15:01
globalization with only javascript
<script type="text/javascript" src="util.js"></script>
In your util.js you do:
alert(MyStrings.WelcomeMessage);
@goenning
goenning / gist:1486348
Created December 16, 2011 14:55
globalization with javascript and razor
<script type="text/javascript">
var message = '@(MyStrings.WelcomeMessage)';
</script>
<script type="text/javascript" src="util.js"></script>
Then, in your util.js you do:
alert(message);
@goenning
goenning / gist:1462478
Created December 11, 2011 20:10
Highcharts MVC ajax-enabled example
@(
Html.Highchart("myAjaxChart")
.Title("Tickets per month")
.WithSerieType(ChartSerieType.Column)
.AxisX("Jan", "Feb", "Mar")
.AxisY("Quantity")
.Series(
AjaxConfig.LoadFrom(Url.Action("LoadData", "Ajax")).Reload(5000)
)
.ToHtmlString()
@goenning
goenning / gist:1462473
Created December 11, 2011 20:09
Pure Highcharts ajax-enabled example
var myAjaxChart;
$(document).ready(function () {
myAjaxChart = new Highcharts.Chart({
chart: {
renderTo: 'myAjaxChart',
type: 'column'
}, title: {
text: 'Tickets per month'
}, xAxis: {
categories: ['Jan','Feb','Mar']
@goenning
goenning / AdminAreaRegistration.cs
Created December 3, 2011 11:03
Example of how to use SubdomainRoute class
public class AdminAreaRegistration : AreaRegistration
{
public override string AreaName
{
get { return "Admin"; }
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.Routes.Add("Admin_Home", new SubdomainRoute(
@goenning
goenning / SubdomainRoute.cs
Created December 3, 2011 11:00
SubdomainRoute class for ASP.NET MVC
public class SubdomainRoute : Route, IRouteWithArea
{
private string[] namespaces;
public string Subdomain { get; private set; }
public SubdomainRoute(string subdomain, string url, object defaults, string[] namespaces)
: base(url, new RouteValueDictionary(defaults), new MvcRouteHandler())
{
this.Subdomain = subdomain;
this.namespaces = namespaces;
When I do "git status", this is shown:
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: example/HelloWorldMvc/HelloWorldMvc.csproj
# modified: example/TrackWebService/TrackWebService.csproj
#
# Changed but not updated: