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
# sand box 1 file ------------------------------------------------------------------- | |
import SandBox2 | |
if __name__ == "__main__": | |
print("Executed when invoked directly from SANDBOX 1") | |
else: | |
print("Executed when imported from SANDBOX 1") | |
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
class EvenNum: | |
def __init__(self, size) -> None: | |
self.size = size | |
print(self, end=" : ") | |
def __iter__(self): | |
self.count = 0 | |
return self | |
def __next__(self): |
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
// Listen for submit | |
document.getElementById('loan-form').addEventListener('submit', function (e) { | |
// Hide results | |
document.getElementById('results').style.display = 'none'; | |
// Show loader | |
document.getElementById('loading').style.display = 'block'; | |
setTimeout(calculateResults, 2000); | |
e.preventDefault(); |
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
// Define UI variables | |
const form = document.querySelector('#task-form'); | |
const taskList = document.querySelector('.collection'); | |
const clearBtn = document.querySelector('.clear-tasks'); | |
const filter = document.querySelector('#filter'); | |
const taskInput = document.querySelector('#task'); | |
// Load all event listeners | |
loadEventListeners(); |
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
// Local & Session storage | |
// Only difference = local - data remains // Session - erased when browser closed(session ends) | |
// -------------------------------------------------------------------- | |
// set local storage item | |
localStorage.setItem('name', 'John'); | |
localStorage.setItem('age', '30'); | |
sessionStorage.setItem('name', 'Beth'); |
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
let val; | |
val = document; | |
// val = document.all; | |
// val = document.all[2]; | |
val = document.head; | |
val = document.body; | |
val = document.doctype; |
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
// This file is used in youtube video "Traversy Media". | |
// visit "Traversy Media" down below | |
// https://www.youtube.com/watch?v=rRgD1yVwIvE&list=PLillGF-RfqbbnEGy3ROiLWk7JMCuSyQtX&index=9 | |
const companies= [ | |
{name: "Company One", category: "Finance", start: 1981, end: 2004}, | |
{name: "Company Two", category: "Retail", start: 1992, end: 2008}, | |
{name: "Company Three", category: "Auto", start: 1999, end: 2007}, | |
{name: "Company Four", category: "Retail", start: 1989, end: 2010}, |
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
SELECT COUNT(DISTINCT(*)) FROM _somewhere_ | |
WHERE _something_ <= 12 AND _something2_ = '_word_' | |
WHERE _something_ BETWEEN 8 AND 9 | |
WHERE _something_ IN (0.99, 1.98, 1.99) | |
WHERE _something_ LIKE/ILIKE '_J%' | |
ORDER BY _something_ ASC, _something2_ DESC | |
LIMIT 5; |
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
// EXAMINE THE DOCUMENT OBJECT // -- by Traversy Media | |
console.dir(document); | |
console.log(document.domain); | |
console.log(document.URL); | |
console.log(document.title); | |
//document.title = 123; | |
console.log(document.doctype); | |
console.log(document.head); | |
console.log(document.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
#include <iostream> | |
#include <string> | |
#include <vector> | |
long long int reg_factorial(int num) { | |
long long int res = 1; | |
for (int i = num; i > 0; i--) res *= i; | |
return res; | |
} | |
std::vector<long long int> spe_factorial(int num) { |