Installing hyper-material-theme
. Just follow these instructions.
Set Hyper to use WSL's Bash by default
- Open up Hyper and type
Ctrl
+,
- Scroll down to
"shell"
in the config and change it toC:\\Windows\\System32\\bash.exe
- Reload Hyper
# find various file extensions and copy to provided directory | |
# https://stackoverflow.com/questions/5241625/find-and-copy-files | |
find / \( -name "*.html" \) -exec cp {} /<directory>; | |
# grep to find emails | |
# https://stackoverflow.com/questions/2898463/using-grep-to-find-all-emails | |
grep -Eiorh '([[:alnum:]_.-]+@[[:alnum:]_.-]+?\.[[:alpha:].]{2,6})' "$@" * | sort | uniq > <filename>.txt |
// Simple logging functionality | |
const sqrt = Math.sqrt; | |
console.log("result", sqrt(16)) | |
console.log("result", sqrt(9)) | |
// ======= logging ====== // | |
// Introducing logging within the function |
// another approach is used by libraries such as jQuery | |
// similar to annoymouns-closure.js but now we passing global variables as parameters | |
var $ = { window: {} }; | |
(function (globalVariable) { | |
// Keep this variables private inside this closure scope | |
var privateFunction = function() { | |
console.log('Shhhh, this is private!'); | |
} |
Installing hyper-material-theme
. Just follow these instructions.
Set Hyper to use WSL's Bash by default
Ctrl
+ ,
"shell"
in the config and change it to C:\\Windows\\System32\\bash.exe
function substring(str) { | |
if (str.length <= 1) { | |
return str.length | |
} | |
let startpoint = 0; | |
let max = 0; | |
let len = str.length; | |
let lookup = new Map(); | |
let dictionary = new Map(); |
function balanced(str) { | |
const stack = [] | |
let top; | |
for (let i = 0; i < str.length; i++) { | |
const char = str[i] | |
if (char === "(" || char === "{" || char === "[") { | |
console.log("pushing to stack") | |
stack.push(char) | |
} else { | |
if (stack.length === 0) { |
function checkstring(str) { | |
let pointer = 0; | |
let len = str.length | |
let smileCount = 0 | |
let smileyBank = [] | |
while (pointer < len - 1) { | |
const currentSymbol = str[pointer] | |
const nextSymbol = str[pointer + 1] | |
if (currentSymbol === ":") { | |
console.log(currentSymbol, nextSymbol) |
function printPrime (num) { | |
for (let counter = 1; counter <= num; counter++) { | |
let prime = true; | |
for (let j = 2; j <= counter; j++) { | |
// if it can modus without remainder and it's not it self, means it's not prime | |
if (counter % j === 0 && counter !== j) { | |
prime = false; | |
} | |
} | |
if (prime) { |
class LinkedList { | |
constructor(head=null) { | |
this.head = head; | |
this.count = 0; | |
} | |
add (newData) { | |
// create node | |
// reference previous node to new node | |
let temp = new Node(null, newData); | |
let current = this.head; |