Skip to content

Instantly share code, notes, and snippets.

💩
-

Dmitry Strelkov stk-dmitry

💩
-
Block or report user

Report or block stk-dmitry

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View new.js
<!DOCTYPE html>
<html>
<head>
<script src="mraid.js"></script>
<script type="text/javascript">
var videoLinks = {
horizontal: '{{ .Var "video-horizontal" }}',
vertical: '{{ .Var "video-vertical" }}',
};
@stk-dmitry
stk-dmitry / cloudSettings
Last active Jul 16, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2019-07-16T13:13:59.552Z","extensionVersion":"v3.4.0"}
@stk-dmitry
stk-dmitry / IndexedDB101.js
Last active Feb 8, 2018 — forked from JamesMessinger/IndexedDB101.js
Very Simple IndexedDB Example
View IndexedDB101.js
// This works on all devices/browsers, and uses IndexedDBShim as a final fallback
const indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB;
// Open (or create) the database
const open = indexedDB.open("MyDatabase", 1);
// Create the schema
open.onupgradeneeded = () => {
const db = open.result;
const store = db.createObjectStore("MyObjectStore", {keyPath: "id"});
View hex-opacity-values.txt
Hex Opacity Values
100% — FF
95% — F2
90% — E6
85% — D9
80% — CC
75% — BF
70% — B3
65% — A6
@stk-dmitry
stk-dmitry / vanila-scroll.js
Created Sep 5, 2017
vanila scroll js to section
View vanila-scroll.js
if ('querySelector' in document && 'addEventListener' in window && Array.prototype.forEach) {
const smoothScroll = (anchor, duration) => {
const startLocation = window.pageYOffset;
const endLocation = anchor.offsetTop;
const distance = endLocation - startLocation;
const increments = distance / (duration / 16);
let stopAnimation;
const animateScroll = () => {
window.scrollBy(0, increments);
@stk-dmitry
stk-dmitry / demo.js
Last active May 18, 2017
Using media queries in styled-components
View demo.js
import styled from 'styled-components';
const Layouter = styled.main`
text-align: center;
${media.xs()()`color: grey`};
${media.xs('max')()`color: blue`};
${media.lg('max')()`color: black`};
${media.sm('min')(['orientation: landscape', 'min-color: 4'])`color: black`};
`;
View git-naming.txt
chore: add Oyster build script
docs: explain hat wobble
feat: add beta sequence
fix: remove broken confirmation message
refactor: share logic between 4d3d3d3 and flarhgunnstow
style: convert tabs to spaces
test: ensure Tayne retains clothing
@stk-dmitry
stk-dmitry / config.js
Last active May 24, 2017
flexbox columns config on styled-components
View config.js
const StyleConfig = {
media: {
xs: '468px',
sm: '768px',
md: '970px',
lg: '1170px',
},
};
export default StyleConfig;
View urlregexp.js
function regexpUrlParams(name) {
name = name.replace(/\[/, "\\\[").replace(/\]/, "\\\]");
const regex = new RegExp("[\\?&]" + name + "=([^&#]*)");
const results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
@stk-dmitry
stk-dmitry / .babelrc
Last active Sep 18, 2017
babel config react / es2015
View .babelrc
{
"presets": [ "react", "es2015", "stage-3" ],
"plugins": [
"lodash",
"minify-dead-code-elimination",
"styled-components",
"transform-flow-strip-types",
"transform-decorators-legacy",
"transform-class-properties",
"syntax-trailing-function-commas",
You can’t perform that action at this time.