Skip to content

Instantly share code, notes, and snippets.

View olegdater's full-sized avatar
💭
Busy with Humanornot.so

@HumanCEO olegdater

💭
Busy with Humanornot.so
View GitHub Profile
@olegdater
olegdater / parseAirtableLinks.js
Created January 29, 2023 14:13
Parse airtable link and put source attribute to it
@olegdater
olegdater / config-overrides.js
Created March 6, 2020 13:58
webpack config for html-loader
/* 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,
@olegdater
olegdater / tilda-typeform-send-email.js
Created March 5, 2020 07:57
Send user's email from Tilda.cc form to Typeform
console.log('Success URL script modifier started');
var isAlreadyWatching = {};
$( document ).ready(startSuccessUrlModifier);
function startSuccessUrlModifier() {
console.log('Document is ready');
var elementSelector = '#someElement';
var checkExist = setInterval(function() {
if ($(elementSelector).length >= ) {
console.log("element loaded!");
clearInterval(checkExist);
}
}, 100);
@olegdater
olegdater / close-to-bottom.js
Last active August 25, 2018 13:10
Is ScrollView close to bottom?
const isCloseToBottom = ({ layoutMeasurement, contentOffset, contentSize }) => {
const paddingToBottom = 20;
return layoutMeasurement.height + contentOffset.y >=
contentSize.height - paddingToBottom;
};
<ScrollView
style={styles.scrollViewContainer}
scrollEventThrottle={1000}
onScroll={({ nativeEvent }) => {
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"
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* 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'
@olegdater
olegdater / RNfontWeights.js
Created April 9, 2018 07:15 — forked from knowbody/RNfontWeights.js
React Native Font Weight Cheatsheet iOS
{ 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
0x2A3E912C6787DD11e27c6c6E67deFF1EB4f16Ad9
@olegdater
olegdater / shuffleArray
Created April 22, 2016 04:23
Function to randomly shuffle javascript array
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;