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
// Node Constructor function | |
function Node(value) { | |
this.value = value; | |
this.next = null; | |
} | |
// A linked list with no name using only nodes | |
// 23 -> 17 -> 13 -> 42 -> 99 | |
var head = new Node(23); | |
head.next = new Node(17); |
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
// By Alex https://github.com/AlexVotry | |
// reverse the string | |
// temp variable | |
// split - turns the string into an array | |
// reverse - built in function on array | |
// join - turns an array into a string with a given delimiter '' | |
// compare to original string | |
// if equal return True else return false | |
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
'use strict'; | |
angular | |
.module('CameraShop') | |
.factory('CameraService', CameraService); | |
function CameraService() { | |
let self = this; | |
this.cameras = [ | |
{ |
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
// When creating an iife, use a function, NOT a fat arrow. | |
// With a fat arrow, this is bound to the this of the surrounding code (in this case Window or Global). | |
// Therefore, using a fat arrow negates the use of an iife (to prevent polluting global scope). | |
(() => { | |
'use strict'; | |
console.log('fat arrow', this) | |
})(); |
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
angular.module('RedditApp', []) | |
.controller('RedditController', RedditController); | |
function RedditController($scope){ | |
// Example of async with jQuery here | |
// You should really use $http instead which will call $apply for you | |
$.get('https://www.reddit.com/.json') | |
.done(function(result){ | |
console.log(result); | |
$scope.redditPosts = result.data.children; |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Reveal.js</title> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.3.0/css/reveal.min.css"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.3.0/css/theme/night.min.css" id="theme"> | |
<!-- For syntax highlighting --> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.3.0/styles/hybrid.min.css"> |
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
<!DOCTYPE html> | |
<html lang="en" ng-app="firstFormValidation" ng-controller="mainController"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"> | |
</head> | |
<body class="container"> | |
<h1>Here are our users |
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
<!DOCTYPE html> | |
<html ng-app="TodoApp"> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<link rel="stylesheet" href="https://bootswatch.com/paper/bootstrap.css" media="screen" title="no title" charset="utf-8"> | |
<style media="screen"> | |
.finished { | |
text-decoration: line-through; | |
} |