Skip to content

Instantly share code, notes, and snippets.

View AhmedKorim's full-sized avatar

Ahmed Korim AhmedKorim

View GitHub Profile
import React, {Component, Fragment} from 'react';
import Header from "../layouts/Header";
import classes from './App.scss'
import Button from "@material-ui/core/Button/Button";
class App extends Component {
render() {
return (
<div className={classes.App}>
import React, {Component} from 'react';
import './App.css';
import TestComponent from "./TestComponent";
class App extends Component {
read = 'hi from app';
render() {
return (
<div className="App">
var staticCacheName = 'restaurant-reviews-cache-v1';
self.addEventListener('install', event => {
event.waitUntil(
caches.open(staticCacheName).then(cache => {
return cache.addAll([
'./',
'./js/dbhelper.js',
'./js/main.js',
'./js/restaurant_info.js',
import React from 'react';
class Map extends React.Component {
state = {
mapConatienr: null,
locations: null,
markers: [],
isRendered: false,
bounds: null
};
@AhmedKorim
AhmedKorim / config.js
Created July 19, 2018 11:19
Udacity google maps api
var map;
// Create a new blank array for all the listing markers.
// -- @deleted //
// var markers = [];
function initMap() {
// Constructor creates a new map - only center and zoom are required.
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: 40.7413549, lng: -73.9980244},
@AhmedKorim
AhmedKorim / git-clearHistory
Last active August 4, 2018 00:05 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
@AhmedKorim
AhmedKorim / serve-skeleton-page.js
Created June 30, 2018 23:03 — forked from luke-denton-aligent/serve-skeleton-page.js
This snippet shows how to cache and serve a skeleton page
// Offline Web Applications course on Udacity https://classroom.udacity.com/courses/ud899
//When a browser runs a service worker for the first time, an event is fired within it, 'install'. This can be used
//to trigger functions to download assets and save them to the cache, using the Cache API
//Started with snippet from https://gist.github.com/luke-denton/ef791e5150470814a7a155cd85b1bf80
var staticCacheName = "my-cache-v2"; //Update the cache version
self.addEventListener('install', function(event) {
var urlsToCache = [
@AhmedKorim
AhmedKorim / webpack.lint.config.js
Created May 1, 2018 18:52 — forked from manavsehgal/webpack.lint.config.js
Webpack configuration for running Browsersync, ESLint and StyleLint along with Hot Reloading
// Initialization
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const postcssImport = require('postcss-easy-import');
const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
const path = require('path');
const StyleLintPlugin = require('stylelint-webpack-plugin');
const APP = path.join(__dirname, 'app');