View Flutter-Course-Resources.md
Flutter-Course-Resources
Section 1: Introduction to Cross-Platform Development with Flutter and Dart
Section 2: Setting Up for Flutter Development
View memoization.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
//Basic fibonacci function | |
function fib(value) { | |
if (value <= 1) { | |
return value; | |
} | |
return fib(value - 1) + fib(value - 2); | |
} |
View thisConfusion.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
// Object literals | |
let myObjectLiteral = { | |
variableKey: "variableValue", | |
functionKey: function (params) { | |
// magic goes in here | |
}, | |
}; | |
// module defined with object literal |
View queue.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 Queue() { | |
let items = []; | |
this.enqueue = function (element) { | |
items.push(element); | |
}; | |
this.dequeue = function () { | |
items.shift(); | |
}; | |
this.front = function () { | |
return items[0]; |
View mixed-number-converter.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
// https://www.codewars.com/kata/simple-fraction-to-mixed-number-converter/ | |
var greatest = (a,b) => (b===0) ? a : greatest(b,a%b) | |
function mixedFraction(s){ | |
arr = s.split('/') | |
dividend = Number(arr[0]) | |
divisor = Number(arr[1]) | |
if(divisor === 0){ | |
throw "ZeroDivisionError"; | |
} else { | |
if(dividend%divisor === 0){ |
View Diff 2 Arrays
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 diffArray(arr1, arr2) { | |
//create a placeholder array that will contain the resultant values | |
var newArray = []; | |
//iterate through arr1 | |
for (var i = 0; i < arr1.length; i++) { | |
//if arr2 doesn't contain items in arr1 | |
if (arr2.indexOf(arr1[i]) === -1) { | |
//save it in newArray | |
newArray.push(arr1[i]); | |
} |
View forismatic
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
$(document).ready(function() { | |
var quote; | |
var author; | |
function getNewQuote() { | |
$.ajax({ | |
url: "http://api.forismatic.com/api/1.0/", |
View Where Do I Belong
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 getIndexToIns(arr, num) { | |
//Add the value of num to the array | |
arr.push(num); | |
//Sort the array | |
arr.sort(function(a, b) { | |
return a-b; | |
}); | |
//Get the index of value num | |
arr = arr.indexOf(num); | |
return arr; |
View Seek and Destroy
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 destroyer(arr) { | |
//create a temporary array that includes both the arrays and the arguments, giving a multidimensional array. | |
var args = Array.prototype.slice.call(arguments); | |
//cut out the original array by splicing it out leaving only the arguments | |
args.splice(0,1); | |
//create an empty array that will contain the result after the array and arguments have been compared | |
var newArr= []; | |
//iterate through the original array | |
for (var i = 0; i < arr.length; i++) { | |
//iterate through the arguments array |
NewerOlder