Skip to content

Instantly share code, notes, and snippets.

View pointofpresence's full-sized avatar
🏠
Working from home

ReSampled pointofpresence

🏠
Working from home
View GitHub Profile
@pointofpresence
pointofpresence / geoPositionAsPromise.js
Last active January 10, 2020 07:23
getCurrentPosition promised
var getPosition = function (options) {
return new Promise(function (resolve, reject) {
navigator.geolocation.getCurrentPosition(resolve, reject, options);
});
}
getPosition()
.then((position) => {
console.log(position);
})

HTML Blob in <iframe>

A little hack to test isolated HTML template previewing within a <iframe> using Blob - without need for another server request.

A Pen by grimen on CodePen.

License.

@pointofpresence
pointofpresence / gulpCrashFix.txt
Last active January 19, 2020 19:15
if gulp can't run,..
npm install --unsafe-perm=true
@pointofpresence
pointofpresence / google-adsense-react-component.js
Last active January 20, 2020 18:23
Google Adsense React Component
import React from 'react';
import PropTypes from 'prop-types';
export default class Google extends React.Component {
componentDidMount() {
if(window) (window.adsbygoogle = window.adsbygoogle || []).push({});
};
render() {
return (
@pointofpresence
pointofpresence / filter.svg
Created February 26, 2020 17:55 — forked from subzey/filter.svg
SVG retrowave filter
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pointofpresence
pointofpresence / index.html
Created February 26, 2020 19:20
тень для svg
<svg xmlns="http://www.w3.org/2000/svg" width="31" height="36" viewBox="0 0 31 36"><path fill="#FFF" d="M11 21h7.451c5.247 0 9.5-4.253 9.5-9.5S23.698 2 18.451 2H6v14H2v5h4v3H2v5h4v4h5v-4h15v-5H11v-3zm0-14h7.451v-.03a4.53 4.53 0 0 1 0 9.06V16H11V7z"/></svg>
@pointofpresence
pointofpresence / detect-unused-css-selectors.js
Created April 29, 2020 07:57 — forked from victor-homyakov/detect-unused-css-selectors.js
Detect unused CSS selectors. Show possible CSS duplicates. Monitor realtime CSS usage.
/* eslint-disable no-var,no-console */
// detect unused CSS selectors
(function() {
var parsedRules = parseCssRules();
console.log('Parsed CSS rules:', parsedRules);
detectDuplicateSelectors(parsedRules);
var selectorsToTrack = getSelectorsToTrack(parsedRules);
window.selectorStats = { unused: [], added: [], removed: [] };
console.log('Tracking style usage (inspect window.selectorStats for details)...');
@pointofpresence
pointofpresence / .htaccess
Last active May 2, 2020 20:34
.htaccess for react-router
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
@pointofpresence
pointofpresence / createAndUseCssVariable.css
Last active May 17, 2020 09:11
Как создать и использовать CSS-переменную?
:root {
--main-bg-color: brown;
}
.one {
background-color: var(--main-bg-color);
}