Skip to content

Instantly share code, notes, and snippets.

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

Pavel Ermakov pavermakov

🏠
Working from home
View GitHub Profile
@pavermakov
pavermakov / index.html
Created November 29, 2016 09:11
Simple loading animation ( Loading . . . )
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CSS ui</title>
<style>
* {
box-sizing: border-box;
}
@pavermakov
pavermakov / index.html
Created November 29, 2016 09:43
Bouncing ball loading animation
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CSS ui</title>
<style>
* {
box-sizing: border-box;
}
@pavermakov
pavermakov / index.html
Created November 29, 2016 10:08
Spinner loading animation
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CSS ui</title>
<style>
* {
box-sizing: border-box;
}
@pavermakov
pavermakov / WebViewAutoHeight.js
Created August 23, 2019 10:09 — forked from esamattis/WebViewAutoHeight.js
React native: Is it possible to have the height of a html content in a webview? http://stackoverflow.com/q/32952270
/*
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2016 Esa-Matti Suuronen <esa-matti@suuronen.org>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
@pavermakov
pavermakov / SliderScreen.js
Created September 13, 2019 20:56
React native slider screen
import React from "react";
import { View, Animated, Text, StyleSheet, Button, Dimensions } from "react-native";
const DEVICE_WIDTH = Dimensions.get("window").width;
const SliderScreen = () => {
const animateRight = new Animated.Value(0);
const moveOver = () => {
Animated.timing(animateRight, {
@pavermakov
pavermakov / generateIcons.js
Created December 5, 2019 09:34
Generate icomoon icons
/* eslint-disable no-console */
const fs = require("fs");
const path = require("path");
const pipeline = require("icomoon-cli");
const ICONS_FOLDER = path.join(__dirname, "../icons");
const SELECTION_PATH = path.join(__dirname, "../../configs/humanforce-font-selection.json");
function getIcons() {
return fs.readdirSync(ICONS_FOLDER);
import React, { useState, useEffect, memo } from "react";
import { View, TouchableOpacity, TouchableWithoutFeedback, Animated, StyleSheet } from "react-native";
import { IoniconsIcon } from "~/components/Icons/Ionicons";
import { c, t } from "~/helpers/rootHelper";
import { useKeyboard } from "~/hooks";
const END_HEIGHT = 120;
const START_HEIGHT = 160;
const START_WIDTH = c.DEVICE_WIDTH * 0.7;
import React, { useEffect, useState } from "react";
import { Keyboard } from "react-native";
import { c } from "~/helpers/rootHelper";
const useKeyboard = () => {
const [indent, setIndent] = useState(0);
const isVisible = indent > 0;
const dismiss = () => {
Keyboard.dismiss();
import { useCallback, useEffect, useRef } from 'react';
export function useMounted() {
const refMounted = useRef(false);
useEffect(() => {
refMounted.current = true;
return () => {
refMounted.current = false;
import { useEffect } from "react";
function useDebouncedEffect(fn, deps, time) {
const dependencies = [...deps, fn, time]
useEffect(() => {
const timeout = setTimeout(fn, time);
return () => {
clearTimeout(timeout);
}
}, dependencies);