Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Coding

Favour George phavor

:octocat:
Coding
View GitHub Profile
@phavor
phavor / iphone_media_query.md
Created May 17, 2021 — forked from weird-coon/iphone_media_query.md
CSS media query iPhone breakpoint
View iphone_media_query.md

iPhone 11

/* 1792x828px at 326ppi */
@media only screen 
    and (device-width: 414px) 
    and (device-height: 896px) 
    and (-webkit-device-pixel-ratio: 2) { }

This media query is also for: iPhone XR

@phavor
phavor / largeNumber.js
Created Dec 1, 2020
Return only sorted large pairs
View largeNumber.js
// inputData = 64,120
// 63,121
// 65,100
// 70,150
// 56,90
// 75,190
// 60,95
// 68,110
function writeOutput(inputData) {
@phavor
phavor / printMessage.jsx
Created Dec 1, 2020
Print message to the screen every 1 second
View printMessage.jsx
import React from "react";
const PrintMessage = () => {
const fontFamilies = ["arial", "cursive", "monospace", "sans-serif", "sans"];
let [count, setCount] = React.useState(0);
const printMessage = () => {
return <span className={`${fontFamilies[count]} world`}>World</span>;
};
@phavor
phavor / braces.js
Created Nov 10, 2020
Brace matcher that returns a "YES" or "NO" for a given array item
View braces.js
function braces(values) {
if (values.length === 1) return ["NO"];
const map = {
"(": ")",
"[": "]",
"{": "}"
};
const closing = Object.values(map);
@phavor
phavor / app.ts
Created Oct 9, 2020
Typescript converted file
View app.ts
const quoteContainer = document.getElementById('quote-container');
const loader = document.getElementById('loader');
const quoteText = document.getElementById('quote');
const authorText = document.getElementById('author');
const twitterBtn = document.getElementById('twitter');
const newQuoteBtn = document.getElementById('new-quote');
interface QuoteData {
quoteAuthor: string;
quoteText: string;
@phavor
phavor / tsconfig.json
Created Oct 9, 2020
Ts Quote Generator Config
View tsconfig.json
{
 "compilerOptions": {
 "sourceMap": true,
 "target": "es5",
 "lib": [
 "dom",
 "dom.iterable",
 "ES2015"
 ],
 "module": "CommonJS",
@phavor
phavor / styles.css
Created Oct 5, 2020
Ts Quote generator styles
View styles.css
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@200;300;400;600&display=swap');
html {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
min-height: 100vh;
@phavor
phavor / index.html
Last active Oct 8, 2020
TS Quote generator
View index.html
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Quotifr | Inspirational quotes for your daily start up</title>
<link rel="shortcut icon" href="assets/quote-icon.jpg" type="image/jpg">
<link rel="stylesheet" href="styles/styles.css">
<script defer src="https://use.fontawesome.com/releases/v5.0.8/js/all.js"
integrity="sha384-SlE991lGASHoBfWbelyBPLsUlwY1GwNDJo3jSJO04KZ33K2bwfV9YBauFfnzvynJ"
@phavor
phavor / currencies.js
Created Jan 28, 2020
List of Countries, currencies and code
View currencies.js
export const countries = [
{
code: "AE",
currency: "AED",
currencyName: "United Arab Emirates Dirham",
name: "United Arab Emirates"
},
{
code: "AF",
currency: "AFN",
@phavor
phavor / fly.js
Created Oct 21, 2019
Node script to spawn a new child process
View fly.js
const { spawn, exec } = require('child_process')
const drone = spawn('python', ['./src/controller/main.py'])
drone.stdout.pipe(process.stdout)