Skip to content

Instantly share code, notes, and snippets.

View ajmalafif's full-sized avatar
💻

Ajmal Afif ajmalafif

💻
View GitHub Profile
@ajmalafif
ajmalafif / create-pages-blogs.js
Created April 7, 2019 09:09 — forked from tanaypratap/create-pages-blogs.js
Creating Pages in Gatsby from different data sources and template
/** extracted page creation functionality into smaller functions **/
const path = require('path');
function createBlogPostsPages(result, createPage) {
const blogPostTemplate = path.join(__dirname, `../src/templates/blog-post.js`);
const blogPosts = result.data.blogs.edges;
blogPosts.forEach((post, index) => {
const previous = index === blogPosts.length - 1 ? null : blogPosts[index + 1].node;
@ajmalafif
ajmalafif / package.json
Created February 2, 2019 18:17 — forked from stefanjudis/package.json
Cached SQIP implementation on Netlify
{
"name": "sqip-cache-tryout",
"version": "1.0.0",
"description": "",
"main": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "stefan judis <stefanjudis@gmail.com>",
@ajmalafif
ajmalafif / CustomDevide.coffee
Created January 19, 2019 17:54 — forked from koenbok/CustomDevide.coffee
Custom Framer Device
Framer.Device.Devices["my-device"] =
name: "My Device"
deviceType: "mobile"
deviceImage: "my-device.png"
deviceImageWidth: 472
deviceImageHeight: 806
screenWidth: 320
screenHeight: 400
# Insomnia Configuration
## Run the test query
{
shop {
id
name
}
}
# Query Structure Examples
@ajmalafif
ajmalafif / fontFace.js
Created October 28, 2018 15:31 — forked from spences10/fontFace.js
Font Face helper function by mschipperheyn
/**
* Awesome helper function from Marc Schipperheyn
* https://github.com/mschipperheyn 👌
*
*/
export function fontFace(
name,
src,
fontWeight = 'normal',
@ajmalafif
ajmalafif / Component.js
Created October 24, 2018 04:42 — forked from mxstbr/Component.js
styled-components ❤ tachyons
// There's two ways to use Tachyons together with styled-components
// Both are valid, which one you use depends if you want to always apply a tachyons class when a certain component
// is rendered or if you want to apply it for specific instances.
// 1. Use .attrs to define classNames that should always be applied to a styled component
// Whenever you use <Component /> now it'll have both the styled-components as well as the Tachyons class
// See the docs for more info: https://www.styled-components.com/docs/basics#attaching-additional-props
const Component = styled.div.attrs({
className: 'bw0-l',
})`
@ajmalafif
ajmalafif / pagination.md
Created August 31, 2018 19:36 — forked from mislav/pagination.md
"Pagination 101" by Faruk Ateş

Pagination 101

Article by Faruk Ateş, [originally on KuraFire.net][original] which is currently down

One of the most commonly overlooked and under-refined elements of a website is its pagination controls. In many cases, these are treated as an afterthought. I rarely come across a website that has decent pagination, and it always makes me wonder why so few manage to get it right. After all, I'd say that pagination is pretty easy to get right. Alas, that doesn't seem the case, so after encouragement from Chris Messina on Flickr I decided to write my Pagination 101, hopefully it'll give you some clues as to what makes good pagination.

Before going into analyzing good and bad pagination, I want to explain just what I consider to be pagination: Pagination is any kind of control system that lets the user browse through pages of search results, archives, or any other kind of continued content. Search results are the o

import React from 'react';
import styles from './DashedBox.css';
const DashedBox = () => (
<div className={styles.container}>
<p className={styles.content}>Get started with CSS Modules style</p>
</div>
);
export default DashedBox;
.DottedBox {
margin: 40px;
border: 5px dotted pink;
}
.DottedBox_content {
font-size: 15px;
text-align: center;
}
#DIV_1 {
bottom: 0px;
box-sizing: border-box;
color: rgb(4, 4, 2);
cursor: default;
display: flex;
height: 646.75px;
left: 0px;
min-height: auto;
min-width: auto;