This file contains 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
//////////////////////////////////////////////////////////////////////////////// | |
//* *// | |
// - B R A I N S O U R C E - // | |
// Regex-based brainfuck interpreter written in functional Javascript // | |
// Author: Angelos Chalaris (chalarangelo@gmail.com) // | |
// License: MIT License - https://opensource.org/licenses/MIT // | |
// Note: Certain parts might be slow, buggy or even not work at all. Use at // | |
// your own risk. // | |
//* *// | |
//////////////////////////////////////////////////////////////////////////////// |
This file contains 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
function g(){for(var r=String.fromCharCode,n=Math.random,o=r(~~(25*n()+65)),a=b=0;b<32;a=~~(42*n()+48))58>a||a>64?(o+=r(a),b++):a;return o} |
This file contains 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
function UserCard(props) { | |
var user = props.user; | |
return React.createElement( | |
'div', | |
{ className: 'col-md-offset-1 col-lg-offset-2' }, | |
React.createElement( | |
'div', | |
{ className: 'card fluid', id: "user_" + user.login.username }, | |
React.createElement( | |
'div', |
This file contains 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
function SvgMapPin(props) { | |
return React.createElement( | |
'svg', | |
{ xmlns: 'http://www.w3.org/2000/svg', width: '24', height: '24', viewBox: '0 0 24 24', fill: 'none', stroke: '#424242', strokeWidth: '2', strokeLinecap: 'round', strokeLinejoin: 'round' }, | |
React.createElement('path', { d: 'M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z' }), | |
React.createElement('circle', { cx: '12', cy: '10', r: '3' }) | |
); | |
} |
This file contains 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
// Get page scroll percentage. | |
function getScrollPercent() { | |
return ( | |
(document.documentElement.scrollTop || document.body.scrollTop) | |
/ ( (document.documentElement.scrollHeight || document.body.scrollHeight) | |
- document.documentElement.clientHeight) | |
* 100); | |
} |
This file contains 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
{ | |
"name": "Mockup Progressive Web App", | |
"short_name": "Mock PWA", | |
"description": "A mock progressive web app built with React and mini.css.", | |
"lang": "en-US", | |
"start_url": "./index.html", | |
"display": "standalone", | |
"theme_color": "#1a237e", | |
"icons": [ | |
{ |
This file contains 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
// "caches" is a global read-only variable, which is an instance of CacheStorage | |
caches.open(cacheName).then(function(cache) { | |
// Do something with your cache | |
}); | |
// Source: https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage/open |
This file contains 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
"scripts": { | |
"start": "react-scripts start", | |
"build": "react-scripts build && npm run build-rename-replace && npm run build-sw", | |
"test": "react-scripts test --env=jsdom", | |
"eject": "react-scripts eject", | |
"build-sw" : "npm run build-replace-sw-refs && npm run build-minify-sw", | |
"build-rename-replace": "npm run build-rename && npm run build-replace", | |
"build-rename": "npm run build-rename-js && npm run build-rename-css", | |
"build-rename-js": "renamer --regex --find main\\.\\w+\\.js --replace main.js build/static/js/*.js", | |
"build-rename-css": "renamer --regex --find main\\.\\w+\\.css --replace main.css build/static/css/*.css", |
This file contains 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 cacheName = 'mockApp-v1.0.0'; | |
var filesToCache = [ | |
'./', | |
'./index.html', | |
'./manifest.json', | |
'./static/js/bundle.js' | |
]; | |
self.addEventListener('install', function(e) { | |
e.waitUntil(caches.open(cacheName) |
This file contains 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
self.addEventListener('activate', function(e) { | |
e.waitUntil(caches.keys() | |
.then(function(keyList) { | |
return Promise.all(keyList.map(function(key) { | |
if (key !== cacheName) | |
return caches.delete(key); | |
})); | |
})); | |
return self.clients.claim(); | |
}); |
OlderNewer