Skip to content

Instantly share code, notes, and snippets.

View kamaal-'s full-sized avatar

Kamaal Aboothalib kamaal-

View GitHub Profile
const isOBject = obj => {
const type = typeof obj;
return type === "function" || (type === "object" && !!obj);
};
const getRandomKey = () => {
return (
[...Array(10)].map(_ => ((Math.random() * 36) | 0).toString(36)).join`` ||
{}
);
function throttle(){
const timer = 300
}
@kamaal-
kamaal- / App.tsx
Created June 28, 2019 11:45
Drawing rounded cornered rectangle in react-native ART.
import React from 'react'
import { View, ART } from 'react-native'
import Rect from './Rect'
const {Surface} = ART
function App(){
return(
<View style={{backgroundColor: 'rgba(37, 72, 101, 1.0)'}}>
<Surface width={300} height={300}>
<Rect width={100} height={100} fill={'yellow'} stroke={'green'} x={10} y={20} bottomRightRadius={100} bottomLeftRadius={20} topRightRadius={10}/>
@kamaal-
kamaal- / gist:811ac6d56afb29fd5ae7fd346906e2c1
Created July 28, 2016 06:10 — forked from BrettBukowski/gist:3bed4b58276e5596e74f
Perfect vertical+horizontal centering (in SCSS + Bourbon)
// Perfect vertical+horizontal centering.
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
@include prefixer(box-align, center, webkit moz ms spec);
-ms-flex-align: center;
@include prefixer(align-items, center, webkit spec);
<?php
/*--------------------------------------------------------------------*/
add_filter('post_class', 'elephas_post_class_hook' );
if( !function_exists( 'elephas_post_class_hook' ) ){
function elephas_post_class_hook( $post_class ){