Skip to content

Instantly share code, notes, and snippets.

View Gaya's full-sized avatar
🌱
Coding on plants

Gaya Kessler Gaya

🌱
Coding on plants
View GitHub Profile
import { useEffect, useReducer } from 'react';
type PromiseState<T> = {
isPending: false;
isResolved: false;
isError: false;
} | {
isPending: true;
isResolved: false;
isError: false;
@Gaya
Gaya / redux-form-react-quill.jsx
Created November 9, 2017 16:00
How to use React Quill inside Redux Forms
import React from 'react';
import { Field } from 'redux-form';
import ReactQuill from 'react-quill';
function renderQuill({ input }) {
return (
<ReactQuill
{...input}
onChange={(newValue, delta, source) => {
if (source === 'user') {
@Gaya
Gaya / hoc.js
Last active February 16, 2021 10:09
Pure Component HOC in React
import React from 'react';
const someProp = 'We want to pass this as a prop';
// hip and short notation
export const wrapComponent = (UncomposedComponent) => (props) => <UncomposedComponent {...props} someProp={someProp} />;
// Or broken down:
// a factory which wraps a component
function add(thing) {
// dit krijg 'eng' van residentEvil();
// maak alvast een functie die later in then() aangeroepen wordt
return function(list) {
// list = ['leuk']
return list.concat([thing]);
}
}

Keybase proof

I hereby claim:

  • I am gaya on github.
  • I am gaya (https://keybase.io/gaya) on keybase.
  • I have a public key whose fingerprint is 24A6 24FF 20C0 FEDE C90E 72BD 87AD E542 3F7E 019E

To claim this, I am signing this object:

@Gaya
Gaya / SassMeister-input.scss
Created August 5, 2015 07:32
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
@mixin prepend-selector($pre-selector) {
$selector: &;
@at-root {
#{$pre-selector} {
#{$selector} {
@content;
@Gaya
Gaya / SassMeister-input.scss
Created August 5, 2015 07:27
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
@mixin admin-bar {
$selector: &;
@at-root {
body.admin-bar {
#{$selector} {
@content;
@Gaya
Gaya / content.php
Created January 28, 2015 14:50
One of the many reasons I hate WordPress development
global $post;
$post = get_post($id);
setup_postdata($post);
global $more;
$more = 1;
$content = get_the_content(false);
@Gaya
Gaya / vertical-rhytmn.scss
Created November 21, 2014 21:37
Vertical Rhytmn Mixin
/*
* Vertical Rhythmn in Sass with helpful mixins and helpers
* Author: Gaya Kessler
* Version: 0.0.2
* Date: 2014-11-20
*/
@if variable-exists(base-font-size) == false {
$base-font-size: 16px;
}
@Gaya
Gaya / video-ratio.css
Created October 15, 2014 09:19
Keep video aspect ratio while scaling
.videoWrapper {
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 0px; /* You can add the interface buttons' room here if any */
height: 0;
}
.videoWrapper iframe {
position: absolute;
top: 0;