Skip to content

Instantly share code, notes, and snippets.

@simpleprogrammer-shared
simpleprogrammer-shared / getting-started-with-meteor-tutorial-4.js
Last active July 20, 2016 04:03
Getting Started With Meteor Tutorial (In the Cloud) 4
if (Meteor.isClient) {
Template.list.helpers({
items: function() {
return
[
{ description: "Do laundry" },
{ description: "Take a nap" },
{ description: "Clean desk" }
];
},
@simpleprogrammer-shared
simpleprogrammer-shared / getting-started-with-meteor-tutorial-2.html
Created July 20, 2016 04:01
Getting Started With Meteor Tutorial (In the Cloud) 2
<head>
<title>Spartan TODO</title>
</head>
<body>
<h1>DO OR DIE!</h1>
{{> list}}
{{> controls }}
</body>
@simpleprogrammer-shared
simpleprogrammer-shared / getting-started-with-meteor-tutorial-1.html
Created July 20, 2016 03:59
Getting Started With Meteor Tutorial (In the Cloud)
<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>
@simpleprogrammer-shared
simpleprogrammer-shared / why-comments-are-stupid-7.cs
Created July 20, 2016 03:56
Why Comments Are Stupid, a Real Example 7
public void Split()
{
if (validatedFullPath != null)
{
IgnoreTrailingSlash();
FindPivotIndexBetweenEndOfStringAndRoot();
if(!pivotFound)
TrimDirectory();
@simpleprogrammer-shared
simpleprogrammer-shared / why-comments-are-stupid-6.cs
Created July 20, 2016 03:55
Why Comments Are Stupid, a Real Example 6
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);
@simpleprogrammer-shared
simpleprogrammer-shared / why-comments-are-stupid-6.cs
Created July 20, 2016 03:55
Why Comments Are Stupid, a Real Example 6
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);
@simpleprogrammer-shared
simpleprogrammer-shared / why-comments-are-stupid-5.cs
Created July 20, 2016 03:52
Why Comments Are Stupid, a Real Example 5
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)
@simpleprogrammer-shared
simpleprogrammer-shared / why-comments-are-stupid-4.cs
Created July 20, 2016 03:51
Why Comments Are Stupid, a Real Example 4
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)
@simpleprogrammer-shared
simpleprogrammer-shared / why-comments-are-stupid-3.cs
Created July 20, 2016 03:50
Why Comments Are Stupid, a Real Example 3
public class DirectoryFileSplitter
{
private readonly string validatedFullPath;
private int length;
private int rootLength;
public DirectoryFileSplitter(string validatedFullPath)
{
this.validatedFullPath = validatedFullPath;
}
@simpleprogrammer-shared
simpleprogrammer-shared / why-comments-are-stupid-2.cs
Created July 20, 2016 03:49
Why Comments Are Stupid, a Real Example 2
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);