Skip to content

Instantly share code, notes, and snippets.

View yasirjanjua's full-sized avatar
🎯
Focusing

Yasir Janjua yasirjanjua

🎯
Focusing
  • Lahore,Pakistan
View GitHub Profile
@yasirjanjua
yasirjanjua / JS Drills.txt
Created May 27, 2017 07:55
Thinkful Js Drills
WisePersonGenerator
function wisePerson(wiseType, whatToSay) {
// your code here
var str = 'A wise ' + wiseType + ' once said: "' +
whatToSay + '".';
return str;
}
/* From here down, you are not expected to
AreaOfRectangle
function computeArea(width, height) {
// your code here
return width*height
}
/* From here down, you are not expected to
understand.... for now :)
Traffic Lights
https://jsbin.com/getecu/edit?js,console,output
Errors
https://jsbin.com/saqeca/edit?js,console,output
<h1>Drill 1<h1/>
<a class="jsbin-embed" href="https://jsbin.com/woyefo/embed?js,console">JS Bin on jsbin.com</a><script src="https://static.jsbin.com/js/embed.min.js?4.0.2"></script>
<h1>Drill 2<h1/>
<a class="jsbin-embed" href="https://jsbin.com/lobolob/embed?js,console">JS Bin on jsbin.com</a><script src="https://static.jsbin.com/js/embed.min.js?4.0.2"></script>
<h1>Drill 3<h1/>
<a class="jsbin-embed" href="https://jsbin.com/nigeke/1/embed?js,console">JS Bin on jsbin.com</a><script src="https://static.jsbin.com/js/embed.min.js?4.0.2"></script>
<h1>Drill 4<h1/>
<a class="jsbin-embed" href="https://jsbin.com/qelazu/5/embed?js,console">JS Bin on jsbin.com</a><script src="https://static.jsbin.com/js/embed.min.js?4.0.2"></script>
<h1>Find<h1/>
<a class="jsbin-embed" href="https://jsbin.com/wiwijac/1/embed?js,output">JS Bin on jsbin.com</a><script src="https://static.jsbin.com/js/embed.min.js?4.0.2"></script>
What is scope? Your explanation should include the idea of global vs. local scope.
JavaScript has two scopes: global and local. A variable that is declared outside a function definition is a global variable, and its value is accessible and modifiable throughout your program. A variable that is declared inside a function definition is local
Why are global variables avoided?
Global variables are accessible through out the program and their value can be manipulated unwantedly which causes error. That is why global variables are avoided.
Explain JavaScript's strict mode
JavaScript strict mode changes silent mistakes to throw erroes.It doesn't allow any variable to get initialize without proper delaration.
What are side effects, and what is a pure function?
A pure function doesn't depend on and doesn't modify the states of variables out of its scope. Concretely, that means a pure function always returns the same result given same parameters.
Explain variable hoisting in JavaScript.
The behaviour of js interpreter
drill 1
https://jsbin.com/fenonuq/edit?js,console
drill 2
https://jsbin.com/yejarip/edit?js,console
drill 3
https://jsbin.com/sunuboz/edit?js,console
drill 4
https://jsbin.com/jijarix/edit?js,console
drill 1
href="https://jsbin.com/jehiyes/embed?js,console"
drill 2
https://jsbin.com/rawebir/edit?js,console
drill 3
https://jsbin.com/sifawow/edit?js,console
drill 4
https://jsbin.com/dudinex/edit?js,console
drill 5
https://jsbin.com/jegixi/edit?js,console
drill 1
https://jsbin.com/ratobix/edit?js,output
drill 2
https://jsbin.com/razodol/edit?js,console,output
drill 3
https://jsbin.com/wuxinit/edit?html,js,console,output
@yasirjanjua
yasirjanjua / trial.key
Last active October 13, 2022 01:22 — forked from huqi/trial.key
Beyond Compare 4 Windows
Beyond Compare 4
Licensed to: ASIO Allsoftinone
Quantity: 1 user
Serial number: 1822-9597
License type: Pro Edition for Windows
--- BEGIN LICENSE KEY ---
H1bJTd2SauPv5Garuaq0Ig43uqq5NJOEw94wxdZTpU-pFB9GmyPk677gJ
vC1Ro6sbAvKR4pVwtxdCfuoZDb6hJ5bVQKqlfihJfSYZt-xVrVU27+0Ja
hFbqTmYskatMTgPyjvv99CF2Te8ec+Ys2SPxyZAF0YwOCNOWmsyqN5y9t
@yasirjanjua
yasirjanjua / events-store.xml
Last active August 12, 2020 12:39
Sample WSO2 Message Store for RabbitMQ Broker
<?xml version="1.0" encoding="UTF-8"?>
<messageStore class="org.apache.synapse.message.store.impl.rabbitmq.RabbitMQStore" name="events-store" xmlns="http://ws.apache.org/ns/synapse">
<parameter name="store.rabbitmq.host.name">localhost</parameter>
<parameter name="store.failover.message.store.name">failover-events-store</parameter>
<parameter name="store.producer.guaranteed.delivery.enable">true</parameter>
<parameter name="store.rabbitmq.host.port">5672</parameter>
<parameter name="store.rabbitmq.route.key">events</parameter>
<parameter name="store.rabbitmq.username">guest</parameter>
<parameter name="rabbitmq.connection.ssl.enabled">false</parameter>
<parameter name="store.rabbitmq.exchange.name">events-exchange</parameter>