Skip to content

Instantly share code, notes, and snippets.

@msteckyefantis
msteckyefantis / getIfValueIsUrl.js
Last active October 15, 2018 16:56
getIfValueIsUrl
function getIfValueIsUrl( value ) {
const urlRegex = /[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?/gi;
const valueIsUrl = !!value.match( urlRegex );
return valueIsUrl;
}
@msteckyefantis
msteckyefantis / loop.js
Created October 15, 2018 16:27
object looping
const object = { x: 2, y: 'yo' };
const keys = Object.keys( object );
keys.forEach( key => {
const value = object[ key ];
publishValue( value );
});
@msteckyefantis
msteckyefantis / meta_template.html
Created July 6, 2018 12:39
the one used for lessonshop, test your url at https://developers.facebook.com/tools/debug/
<title>LessonShop.net</title>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
<meta property="og:url" content="https://lessonshop.net" />
<meta property="og:title" content="LessonShop.net" />
<meta property="og:type" content="website" />
<meta property="og:description" content="Lessonshop is a lesson bookings marketplace that allows you to effortlessly take or teach lessons." />
<meta property="og:image" content="https://s3.amazonaws.com/lessonshop.net/other/the_logo_300_new.jpg" />
<meta property="fb:app_id" content="1515460021880400" />
<meta name="description" content="Lessonshop is a lesson bookings marketplace that allows you to effortlessly take or teach lessons." />
return e(
'div',
{
style: {
width: 100,
height: 100,
backgroundColor: 'green'

ReduxX

npm version Build Status

ReduxX

Similar to SpaceX and iPhoneX, ReduxX is the next generation React state management tool.

(with 100% code coverage😉👍🏿👍🏽👍🏻)

ReduxX is a lightweight yet super-powerful, very easy to learn, and very easy to set up React state management library.

<html>
<head>
<title>Developerayo Div Tricks</title>
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<style>
#oval {
function getDecodedJWTComponents( token ) {
const periodSplitToken = token.split( '.' );
const endcodedJWTHeader = periodSplitToken[0];
const header = getDecodedJWTComponent( endcodedJWTHeader );
const endcodedJWTPayload = periodSplitToken[1];
@msteckyefantis
msteckyefantis / variable_swap.js
Last active April 2, 2018 08:29
Swapping the Values of Two Variables
'use strict';
// Problem: Variables a and b are defined below. How do you swap the values of variables a and b?:
let a = 2; // a is now 2
let b = 3; // b is now 3
@msteckyefantis
msteckyefantis / variable_swap.js
Created April 2, 2018 07:47
Swapping the Values of Two Variables
'use strict';
let a = 2; // a is now 2
let b = 3; // b is now 3
let c = a;
a = b;
<html>
<head>
<title>50 Div Tricks</title>
<style>
body,html {