This file contains hidden or 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
.banner-bottom { | |
position: fixed; | |
left: 0px; | |
top: 0px; | |
height: 55px; | |
width: 100%; | |
color: #fff; | |
background: #001429; | |
z-index: 1333333337!important; | |
} |
This file contains hidden or 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
var banner_bottom = '<div class="banner-bottom">'+ | |
' <div class="banner-bottom-content">'+ | |
' <span>Lorem Ipsum Dolor!</span>'+ | |
' <a class="c-btn" target="_blank" href="https://www.google.com" title="Click me">CLICK ME!</a>'+ | |
' </div>'+ | |
' <div class="banner-close">'+ | |
' x'+ | |
' </div>'+ | |
'</div>'; |
This file contains hidden or 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
window.location.href.split(/[?#]/)[0] + '/' |
This file contains hidden or 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
// CRUD create read update delete | |
const { MongoClient, ObjectID } = require('mongodb') | |
const connectionURL = 'mongodb://127.0.0.1:27017' | |
const databaseName = 'databaseName' | |
MongoClient.connect(connectionURL, { useNewUrlParser: true }, (error, client) => { | |
if (error) { |
This file contains hidden or 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
const mongodb = require('mongodb') | |
const MongoClient = mongodb.MongoClient | |
const connectionURL = 'mongodb://127.0.0.1:27017' | |
const databaseName = 'customDatabaseName' | |
MongoClient.connect(connectionURL, { useNewUrlParser: true }, (error, client) => { | |
if (error) { | |
return console.log('Unable to connect to database!') | |
} |
This file contains hidden or 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
const url = 'http://api.fetchurl.com' | |
fetch(url).then((response) => { | |
response.json().then((data) => { | |
console.log(data) | |
}) | |
}) | |
// expected output: JSON Object |
This file contains hidden or 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
const request = require('request') | |
const express = require('express') | |
const app = express() | |
app.get('/', (req, res) => { | |
if (!req.query.search) { | |
return res.send('Please provide a search string...') |
This file contains hidden or 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
const express = require('express') | |
const app = express() | |
app.get('/', (req, res) => { | |
res.send('Hello World') | |
}) | |
app.listen(3000, (err) => { | |
if (err) { | |
console.log("Error: ", err) |
This file contains hidden or 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
// Swaping two elements in plain JS | |
function swapElements(obj1, obj2) { | |
// create marker element and insert it where obj1 is | |
var temp = document.createElement("div"); | |
obj1.parentNode.insertBefore(temp, obj1); | |
// move obj1 to right before obj2 | |
obj2.parentNode.insertBefore(obj1, obj2); |
This file contains hidden or 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
// Restore console.log() | |
javascript: (function() { | |
var i = document.createElement('iframe'); | |
i.style.display='none'; | |
document.body.appendChild(i); | |
window.console=i.contentWindow.console; | |
}()); |
NewerOlder