Skip to content

Instantly share code, notes, and snippets.

View haikyuu's full-sized avatar

Abdellah haikyuu

View GitHub Profile
@haikyuu
haikyuu / autumn.config.js
Created August 14, 2020 18:30
Configuration for Autumn for my Mac. (reusable)
const createToggler = (name) => () => {
const app = App.find(name)
if (App.focusedApp() === app) {
app.hide()
} else {
App.open(name)
}
}
// Hotkey.activate(['command'], '\\', createToggler('WebStorm'));
@haikyuu
haikyuu / restaurant.js
Created July 22, 2020 10:46
Strapi extend controller
'use strict';
/**
* Read the documentation (https://strapi.io/documentation/v3.x/concepts/controllers.html#core-controllers)
* to customize this controller
*/
const { parseMultipartData, sanitizeEntity } = require('strapi-utils');
module.exports = {
@haikyuu
haikyuu / gist:4c6a1f6ca2b6a9db45a239eb0fb92683
Created March 30, 2020 16:49 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@haikyuu
haikyuu / Webview.jsx
Created January 16, 2020 13:02
how to display a loading spinner while the webview page is loading in react-native
{this.state.isLoading ? (
<ActivityIndicator size="large" style={{ alignSelf: 'center', marginTop: 150 }} />
) : null}
<WebView
useWebKit
style={{ width: '100%', display: !this.state.isLoading ? 'flex' : 'none' }}
source={{ uri: 'https://google.com' }}
injectedJavaScript={`
window.ReactNativeWebView.postMessage('loaded')
`}
@haikyuu
haikyuu / vim-cheatsheet.md
Last active December 24, 2018 11:40
VIM cheatsheet

Netrw

SHORTCUT Description
o open file in horizontal split
v open file in vertical split
git diff Show file differences that haven't been staged
COMMAND Description
@haikyuu
haikyuu / tutorial.md
Created July 20, 2018 16:59 — forked from swalkinshaw/tutorial.md
Designing a GraphQL API

Tutorial: Designing a GraphQL API

This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.

It's based on lessons learned from creating and evolving production schemas at Shopify over almost 3 years. The tutorial has evolved and will continue to change in the future so nothing is set in stone.

Theming Ant Design with Sass and Webpack

This is a solution on how to theme/customize Ant Design (which is written in Less) with Sass and webpack. Ant itself offers two solutions and a related article on theming, but these are only applicable if you use Less, the antd-init boilerplate or dva-cli.

What this solution offers:

  • use a single sass-file to customize (no duplicate variables for your project and Ant)
  • hot reload compatibility
  • no dependencies on outdated npm modules
  • easy integration with your existing webpack setup (webpack 3+ tested)
const type = val =>
val === null
? 'Null'
: val === undefined
? 'Undefined'
: Object.prototype.toString.call(val).slice(8, -1)

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@haikyuu
haikyuu / flow-redux.guideline.md
Created November 13, 2017 15:19 — forked from sibelius/flow-redux.guideline.md
How to easily type Redux Props with Flow

How to easily type Redux Props with Flow

Add ExtractReturn helper

// https://hackernoon.com/redux-flow-type-getting-the-maximum-benefit-from-the-fewest-key-strokes-5c006c54ec87
// https://github.com/facebook/flow/issues/4002
// eslint-disable-next-line no-unused-vars
type _ExtractReturn<B, F: (...args: any[]) => B> = B;
export type ExtractReturn = _ExtractReturn&lt;*, F&gt;;