Here's the code written during the workshop.
View main.bundle.js
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
/******/ (function(modules) { // webpackBootstrap | |
/******/ // The module cache | |
/******/ var installedModules = {}; | |
/******/ | |
/******/ // The require function | |
/******/ function __webpack_require__(moduleId) { | |
/******/ | |
/******/ // Check if module is in cache | |
/******/ if(installedModules[moduleId]) { | |
/******/ return installedModules[moduleId].exports; |
View lesson-1-global-context.js
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
// "use strict"; | |
console.log(this === window); |
View arrow-functions.js
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
const square = function(x) { | |
return x * x; | |
}; | |
const cube = (x) => { | |
return x * x * x; | |
}; | |
const numbers = [11, 20, 33, 40, 55]; |
View deserialization.js
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
const DATE_PATTERN = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+$/; | |
function deserializeProperty(key, value) { | |
return typeof value === "string" && DATE_PATTERN.test(value) | |
? new Date(value) | |
: value; | |
} | |
const obj = JSON.parse('{ "date": "2016-04-26T18:09:16.61" }', deserializeProperty); | |
console.log(typeof obj.date); |
View .eslintrc
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
{ | |
"env": { | |
"es6": true, | |
"browser": true, | |
"node": true | |
}, | |
"ecmaFeatures": { | |
"modules": true | |
}, | |
"rules": { |
View HtmlHelperExtensions.cs
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
using System.Linq; | |
using System.Web; | |
using System.Web.Mvc; | |
using System.Web.Optimization; | |
public static class HtmlHelperExtensions | |
{ | |
public static IHtmlString InlineScripts(this HtmlHelper htmlHelper, string bundleVirtualPath) | |
{ | |
return htmlHelper.InlineBundle(bundleVirtualPath, htmlTagName: "script"); |
View Digits.cs
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
var digitRegex = new Regex(@"\d"); | |
IEnumerable<char> digitCharacters = Enumerable | |
.Range(1, Char.MaxValue) | |
.Select(Convert.ToChar) | |
.Where(c => digitRegex.IsMatch(c.ToString())); |
View IndentedTextWriterDemo.cs
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
using System; | |
using System.CodeDom.Compiler; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
namespace IndentedTextWriterDemo | |
{ | |
public class TodoItem | |
{ |
View trimStart.js
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
function trimStart(character, string) { | |
var startIndex = 0; | |
while (string[startIndex] === character) { | |
startIndex++; | |
} | |
return string.substr(startIndex); | |
} |
NewerOlder