Skip to content

Instantly share code, notes, and snippets.

View oliverwebr's full-sized avatar
🤷‍♂️

Oliver Weber oliverwebr

🤷‍♂️
  • Berlin
View GitHub Profile
@oliverwebr
oliverwebr / simpler-apis.js
Created June 12, 2020 12:34
JS-Closures Example-1: Simpler APIs
function createTranslation(lang) {
const dictionary = {
food: {
en: "food",
de: "essen",
},
apple: {
en: "apple",
de: "apfel",
},
@oliverwebr
oliverwebr / closures-for-privat-values.js
Created June 12, 2020 12:00
JS-Closures Example-1: Privat Values
const createCounter = () => {
let _privatCounter = 0;
const increment = () => {
_privatCounter += 1;
};
const decrement = () => {
_privatCounter -= 1;
};
@oliverwebr
oliverwebr / debug-closure.js
Last active June 11, 2020 23:19
JavaScript Closures with Examples Explained - 3
(function () {
let myLuckyNumber = 5;
function main() {
debugger;
// the debugger statement sets a breakpoint, when your
// developer-tools are open your application will stop here
console.log(myLuckyNumber);
}
@oliverwebr
oliverwebr / closure.js
Last active June 11, 2020 23:05
JavaScript Closures with Examples Explained - 2
(function () {
let myLuckyNumber = 5;
function main() {
console.log(myLuckyNumber);
}
main();
})();
@oliverwebr
oliverwebr / lexical_environment_scope.js
Last active June 11, 2020 23:03
JavaScript Closures with Examples Explained - 1
(function () {
let myLuckyNumber = 5;
function main() {
let myLuckyNumber = 10;
console.log(myLuckyNumber);
}
main();
})();
const express = require('express');
const app = express();
// Application
app.get('/', function(req, res) {
if (process.env.NODE_ENV === 'development') {
for (var key in require.cache) {
delete require.cache[key];
}
}
#!/bin/bash
# Update packages
sudo apt update && sudo apt-get upgrade -y
# Install needed tools
sudo apt install curl wget htop -y
# Installing Sublime Text + Git
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -

Keybase proof

I hereby claim:

  • I am oliverwebr on github.
  • I am oliverwebr (https://keybase.io/oliverwebr) on keybase.
  • I have a public key ASB3_0cjwV40_bGQnOh-jXkUdbkNAV79_TqN73FwfJvhGwo

To claim this, I am signing this object:

@oliverwebr
oliverwebr / today.md
Last active February 12, 2018 08:15
Schedule - 12.02.2018

Today - 12.02.2018

Time Topics
09:00 - 09:45 Code School or Pluralsight
09:45 - 10:30 Questions & What is wrong and why we need to solve it? (Shopping Cart Project)
10:30 - 10:45 Short break
10:45 - 12:15 Questions and Decouple into multiple Classes
12:15 - 13:00 Lunch break
13:00 - 14:30 - Decouple your app into modules / components - Use a pub/sub pattern to let components listen on data changes Check out this video you can find the pub/sub code here
@oliverwebr
oliverwebr / day schedule - 08.02.2018.md
Created February 8, 2018 08:05
DCI FBW-6 Schedule - 08.02.2018

Today

Time Topics
09:00 - 10:30 Code School or Pluralsight
10:30 - 10:45 Short break
10:45 - 12:15 Continue with shopping-cart - finish your own ideas
12:15 - 13:00 Lunch break
13:00 - 14:30 - Decouple your app in to modules / components
- Use a pub/sub pattern to let components listen on data changes

Check out this video you can find the pub/sub code here
14:30 - 14:45 Short break