This file contains 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
if (Meteor.isClient) { | |
Template.list.helpers({ | |
items: function() { | |
return | |
[ | |
{ description: "Do laundry" }, | |
{ description: "Take a nap" }, | |
{ description: "Clean desk" } | |
]; | |
}, |
This file contains 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
<head> | |
<title>Spartan TODO</title> | |
</head> | |
<body> | |
<h1>DO OR DIE!</h1> | |
{{> list}} | |
{{> controls }} | |
</body> |
This file contains 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
<head> | |
<title>Spartan TODO</title> | |
</head> | |
<body> | |
<h1>DO OR DIE!</h1> | |
<ul> | |
<li>Create a Meteor app</li> | |
<li>Work out</li> | |
<li>Eat dinner</li> |
This file contains 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
public void Split() | |
{ | |
if (validatedFullPath != null) | |
{ | |
IgnoreTrailingSlash(); | |
FindPivotIndexBetweenEndOfStringAndRoot(); | |
if(!pivotFound) | |
TrimDirectory(); |
This file contains 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
internal static void SplitDirectoryFile(string path, out string directory, out string file) | |
{ | |
directory = null; | |
file = null; | |
// assumes a validated full path | |
if (path != null) | |
{ | |
int length = path.Length; | |
int rootLength = GetRootLength(path); |
This file contains 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
internal static void SplitDirectoryFile(string path, out string directory, out string file) | |
{ | |
directory = null; | |
file = null; | |
// assumes a validated full path | |
if (path != null) | |
{ | |
int length = path.Length; | |
int rootLength = GetRootLength(path); |
This file contains 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
public class DirectoryFileSplitter | |
{ | |
private readonly string validatedFullPath; | |
private int length; | |
private int rootLength; | |
private bool pivotFound; | |
public string Directory { get; set; } | |
public string File { get; set; } | |
public DirectoryFileSplitter(string validatedFullPath) |
This file contains 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
public class DirectoryFileSplitter | |
{ | |
private readonly string validatedFullPath; | |
private int length; | |
private int rootLength; | |
private bool pivotFound; | |
public string Directory { get; set; } | |
public string File { get; set; } | |
public DirectoryFileSplitter(string validatedFullPath) |
This file contains 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
public class DirectoryFileSplitter | |
{ | |
private readonly string validatedFullPath; | |
private int length; | |
private int rootLength; | |
public DirectoryFileSplitter(string validatedFullPath) | |
{ | |
this.validatedFullPath = validatedFullPath; | |
} |
This file contains 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
internal static void SplitDirectoryFile(string validatedFullPath, out string directory, out string file) | |
{ | |
directory = null; | |
file = null; | |
if (validatedFullPath != null) | |
{ | |
int length = validatedFullPath.Length; | |
int rootLength = GetRootLength(validatedFullPath); |