Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Busy with Dater.com App

Oleg Dater olegwn

💭
Busy with Dater.com App
View GitHub Profile
@olegwn
olegwn / config-overrides.js
Created Mar 6, 2020
webpack config for html-loader
View config-overrides.js
/* eslint-disable no-unused-vars */
/* eslint-disable no-param-reassign */
module.exports = function override(config, env) {
if (!config.plugins) {
config.plugins = [];
}
config.module.rules.push({
test: /\.html$/i,
@olegwn
olegwn / tilda-typeform-send-email.js
Created Mar 5, 2020
Send user's email from Tilda.cc form to Typeform
View tilda-typeform-send-email.js
console.log('Success URL script modifier started');
var isAlreadyWatching = {};
$( document ).ready(startSuccessUrlModifier);
function startSuccessUrlModifier() {
console.log('Document is ready');
View Element-exists.js
var elementSelector = '#someElement';
var checkExist = setInterval(function() {
if ($(elementSelector).length >= ) {
console.log("element loaded!");
clearInterval(checkExist);
}
}, 100);
@olegwn
olegwn / close-to-bottom.js
Last active Aug 25, 2018
Is ScrollView close to bottom?
View close-to-bottom.js
const isCloseToBottom = ({ layoutMeasurement, contentOffset, contentSize }) => {
const paddingToBottom = 20;
return layoutMeasurement.height + contentOffset.y >=
contentSize.height - paddingToBottom;
};
<ScrollView
style={styles.scrollViewContainer}
scrollEventThrottle={1000}
onScroll={({ nativeEvent }) => {
View import-firestore.js
import { remoteConfig } from './index';
const admin = require('../functions/node_modules/firebase-admin');
const _ = require('../functions/node_modules/lodash');
const serviceAccount = require('../configs//firebase/service-key.development.json');
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
// databaseURL: "https://<your-database-name>.firebaseio.com"
View geodesy-tools.js
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* Latitude/longitude spherical geodesy tools (c) Chris Veness 2002-2017 */
/* MIT Licence */
/* www.movable-type.co.uk/scripts/latlong.html */
/* www.movable-type.co.uk/scripts/geodesy/docs/module-latlon-spherical.html */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
'use strict';
if (typeof module!='undefined' && module.exports) var Dms = require('./dms'); // ≡ import Dms from 'dms.js'
@olegwn
olegwn / RNfontWeights.js
Created Apr 9, 2018 — forked from knowbody/RNfontWeights.js
React Native Font Weight Cheatsheet iOS
View RNfontWeights.js
{ fontWeight: '100' }, // Thin
{ fontWeight: '200' }, // Ultra Light
{ fontWeight: '300' }, // Light
{ fontWeight: '400' }, // Regular
{ fontWeight: '500' }, // Medium
{ fontWeight: '600' }, // Semibold
{ fontWeight: '700' }, // Bold
{ fontWeight: '800' }, // Heavy
{ fontWeight: '900' }, // Black
View kovan
0x2A3E912C6787DD11e27c6c6E67deFF1EB4f16Ad9
@olegwn
olegwn / shuffleArray
Created Apr 22, 2016
Function to randomly shuffle javascript array
View shuffleArray
function shuffle(array) {
var currentIndex = array.length, temporaryValue, randomIndex;
// While there remain elements to shuffle...
while (0 !== currentIndex) {
// Pick a remaining element...
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex -= 1;
View gist:b8b98b9fd20933e35585
Verifying that +olegwn is my openname (Bitcoin username). https://onename.io/olegwn