Skip to content

Instantly share code, notes, and snippets.

View geongeorge's full-sized avatar
👋
Hello

Geon George geongeorge

👋
Hello
View GitHub Profile
@geongeorge
geongeorge / Tailwind Spacing Helpers.scss
Created May 23, 2020 12:57
Generate Tailwind CSS style spacing helpers for margin and paddings
// Generate Margin and Padding helpers similar to Tailwind CSS
// https://tailwindcss.com/docs/margin/
// https://tailwindcss.com/docs/padding/
// generated output CSS : https://gist.github.com/geongeorge/0135b0d5063ca1184c42fba70eeaae58
$spaceamounts: ((0,0), (1,0.25),(2,0.5), (3,0.75), (4,1), (5,1.25), (6,1.5), (8,2), (10,2.5), (12,3), (16,4), (20,5), (24,6), (32,8), (40,10), (48,12), (56,14), (64,16));
$sides: (top, bottom, left, right);
.mt-0, .my-0, .m-0 {
margin-top: 0rem;
}
.pt-0, .py-0, .p-0 {
padding-top: 0rem;
}
.mb-0, .my-0, .m-0 {
margin-bottom: 0rem;
@geongeorge
geongeorge / Tailwind Spacing Helpers New.scss
Created May 15, 2021 12:06
Tailwind Like spacing utility classes
// Generate Margin and Padding helpers similar to Tailwind CSS
// https://tailwindcss.com/docs/margin/
// https://tailwindcss.com/docs/padding/
// Source: https://gist.github.com/geongeorge/c7ce3980cf31c547014d38972580809e
// Generated Output: https://gist.github.com/geongeorge/bfa32854bfe370577335bd9ff4899f14
$spaceamounts: (
(0, 0),
(1, 0.25),
@geongeorge
geongeorge / Inject vConsole.js
Created March 1, 2022 16:03
Inject vConsole to view console on mobile
const script = document.createElement('script')
script.onload = function () {
console.log('Loaded vConsole')
var vConsole = new window.VConsole()
}
script.src = 'https://unpkg.com/vconsole@latest/dist/vconsole.min.js'
console.log('Loading vConsole')
document.head.appendChild(script)
@geongeorge
geongeorge / clean-graphql.js
Created September 18, 2021 15:41
Clean graphql response : Remove edges, node and __typename from graphql response
/**
* Remove edges, node and __typename from graphql response
*
* @param {Object} input - The graphql response
* @returns {Object} Clean graphql response
*/
const cleanGraphQLResponse = function (input) {
if (!input) return null;
const isPrimitiveType = (test) => {
/**
* use this to make a Base64 encoded string URL friendly,
* i.e. '+' and '/' are replaced with '-' and '_' also any trailing '='
* characters are removed
*
* @param {String} str the encoded string
* @returns {String} the URL friendly encoded String
*/
function Base64EncodeUrl(str){
return str.replace(/\+/g, '-').replace(/\//g, '_').replace(/\=+$/, '');
<meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="full-screen" content="yes"/>
<meta name="screen-orientation" content="portrait"/>
/** @format */
// Flex parent
.flex {
display: flex;
}
.flex-row {
flex-direction: column;

+--------+-------+ | Letter | count | +--------+-------+ | ആ | 2707 | | ര | 1796 | | ി | 1759 | | റ | 1115 | | സ | 671 | | ഇ | 3874 | | േ | 809 |

@geongeorge
geongeorge / npm start nuxt ihateregex pm2.md
Last active June 8, 2020 08:35
npm start nuxt ihateregex pm2

Do this after build command. Just in case I forget :)

Main

pm2 start npm --name "ihateregex" -- run "start"

Dev