Skip to content

Instantly share code, notes, and snippets.

View BolajiAyodeji's full-sized avatar
🥑
I'm looking for work. Let's talk!

Bolaji Ayodeji BolajiAyodeji

🥑
I'm looking for work. Let's talk!
View GitHub Profile
@BolajiAyodeji
BolajiAyodeji / git-setup.md
Last active March 2, 2019 21:55
How to fix git always asking for username and password

Update the URL of origin remote like, using SSH instead HTTPS;

git remote set-url origin git@github.com:username/repo.git

You can also use;

git config --global credential.helper store

to make git store the username and password and it will never ask for them.

// PWA Fire Bundle
// after a service worker is installed and the user navigates to a different page or
// refreshes,the service worker will begin to receive fetch events
self.addEventListener('fetch', function(event) {
event.respondWith(caches.open('cache').then(function(cache) {
return cache.match(event.request).then(function(response) {
console.log("cache request: " + event.request.url);
var fetchPromise = fetch(event.request).then(function(networkResponse) {
{
"background_color": "#fff",
"display": "standalone",
"orientation":"portrait",
"theme_color": "#fff",
"short_name": "DOB Finder",
"name": "Date of Birth Finder",
"description": "description or purpose of your progressive web app",
"lang": "en-US",
"icons": [
function sumAll(a, b) {
return a + b;
}
export { sumAll };
"use strict";
var math = _interopRequireWildcard(require("./math.js"));
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
console.log(math.sumAll(50, 10));
console.log(math.subtractAll(50, 10));
console.log(math.multiplyAll(50, 10));
console.log(math.divideAll(50, 10));
console.log(math.findModulus(50, 15));
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.multiplyAll = exports.divideAll = exports.subtractAll = exports.sumAll = void 0
var sumAll = function sumAll(a, b) {
return a + b;
};
exports.sumAll = sumAll;
var subtractAll = function subtractAll(a, b) {
command usage
git init Creates an empty Git repository in the specified directory.
git clone <repository name> Clones a repository located at <repository name> onto your local machine.
git add <directory> Stages only the specified changes for the next commit. Replace <directory> with a <file> to change a specific file.
git add . Stages new files and modifications without deletions
git add -A Stages all changes
git add -all Equivalent to git add -A
git add -u Stages modifications and deletions without adding new files
git add --update Equivalent to git add -u
git commit -m ”<message>” Commits the staged snapshot. replace <message> with the commit message.
@BolajiAyodeji
BolajiAyodeji / css-media-queries-cheat-sheet.css
Created March 1, 2019 17:54 — forked from bartholomej/css-media-queries-cheat-sheet.css
CSS Media Query Cheat Sheet (with Foundation)
/*------------------------------------------
Responsive Grid Media Queries - 1280, 1024, 768, 480
1280-1024 - desktop (default grid)
1024-768 - tablet landscape
768-480 - tablet
480-less - phone landscape & smaller
--------------------------------------------*/
@media all and (min-width: 1024px) and (max-width: 1280px) { }
@media all and (min-width: 768px) and (max-width: 1024px) { }
@BolajiAyodeji
BolajiAyodeji / filter-map-reduce.js
Last active March 2, 2019 21:53
Understand filter(), map(), reduce() in 10 seconds
// FILTER(), MAP(), REDUCE()
const boxs = [1, 3, 5, 8, 6, 7, 9];
// FITER()
// This method creates a new array if the items of an array pass a certain condition.
const boxFilter = boxs.filter(box => {
if (box > 3) {
return box;
}
@BolajiAyodeji
BolajiAyodeji / factory-constructor.js
Created March 3, 2019 14:09
Factory Functions vs Construction Functions
// Factory function
// camel naming convention
function createCricle(radius) {
return {
radius,
draw() {
console. log('draw');
}
};