Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
React, Serverless, GraphQL, Docker, AWS

Maxime Janton iam4x

👨‍💻
React, Serverless, GraphQL, Docker, AWS
View GitHub Profile
@iam4x
iam4x / cloudSettings
Created Oct 31, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2019-10-31T00:28:04.459Z","extensionVersion":"v3.4.3"}
View adonis.flow.js
// @flow
/* eslint no-redeclare: off */
/* eslint no-use-before-define: off */
declare type adonis$UntypedModules =
| 'Context/Manager'
| 'Route'
| '@adonisjs/fold'
| 'App/Initializers/Validators/boot'
View use.flow.js
// @flow
/* eslint no-redeclare: off */
/* eslint no-use-before-define: off */
/**
* API Mailers
*/
declare function use(module: 'App/Mailers/Base'): Class<api$BaseMailer>;
View declarative-api.html
<ng-ais-instantsearch>
<ng-ais-search-box placeholder="Search here..."></ng-ais-search-box>
<ng-ais-hits></ng-ais-hits>
</ng-ais-instantsearch>
@iam4x
iam4x / custom-header-menu.js
Created Nov 9, 2017
custom-header-menu.js
View custom-header-menu.js
const search = instantsearch(/* parameters */);
const categoriesToShow = [
'hombres',
'mujeres',
'ninos',
'calzado',
'accesorios',
'marcas',
'reviews'
View pokemonSpots.kml
<?xml version='1.0' encoding='UTF-8'?>
<kml xmlns='http://www.opengis.net/kml/2.2'>
<Document>
<name>pokemonSpots</name>
<NetworkLink>
<name>Map Pokémon GO collaborative</name>
<Link>
<href>http://www.google.com/maps/d/u/0/kml?forcekml=1&amp;mid=1vsj869Axn9JdWairc4xU6E_0DhE</href>
</Link>
</NetworkLink>
View pokemonSpots.kmz
PK˜ÓHdoc.kmlïR€N1}_1}⁄'÷!ï≥QDBjì™$ÍB»Ò≥æ’ó›à?ÍwÙ«jØ∏UÍ ∂ÏÒ9gŒÃòN˜JBጠ£'≈Q9.57µ–Õ§ÿ¨/œäiu@€ÑJHÌ'≈.˚ôêæÔKcQ7¬óIr\’¡àŒ
è
uHÁ’LaıçY¯n⁄?øï—e‹H…∂∆± :§d¿dpçû;aCrS—O∑ÛŸzvªY^]^≠ñ7∞\›¿≈Ï«ztΙMRx|éR"r룜ˆ¨i±«mcJn…y]#h≠uB!XÊ9Œ\⁄≠â.Ü8ÛHÙ jø¢H°C* íO=(&<ƒí=ί(:ñÄâÉàúâ]íïâbsÕ9˛_£ww%Ôõêõ≤ƒ–◊~∫Õ˜èµtD_y#∫s¯PΩ`cL#q»¨òı§&ëåÛ(ßJ‘죌?ûùûœˆ˙¸∫˛…Ñ„'˚ÕÈ‚~<fl-(¥Ü‰%%ˇZ•‰Ì'–,[˝PKúÚápPK˜ÓHúÚápdoc.kmlPK5º
View connectToStores.md

connecToStores.jsx

import React, { Component, PropTypes } from 'react';

export default function connectToStores(reducer) {
  return function(DecoratedComponent) {
    return class ConnectToStoresWrapper extends Component {
      static contextTypes = { flux: PropTypes.object.isRequired }
@iam4x
iam4x / react-intl-wrapper.js
Created Aug 25, 2015
Catch missing translations from `react-intl`
View react-intl-wrapper.js
import { IntlMixin } from 'react-intl';
// prevent app to break when translation is missing
// add message a la i18n Rails
export function getIntlMessage(key) {
try {
return IntlMixin.getIntlMessage.call(this, key);
} catch (error) {
const { locale } = this.props;
return `translation missing ${locale}: ${key}`;
@iam4x
iam4x / autosizetext.coffee
Last active Aug 2, 2018
I wrote this simple function in CoffeeScript which tests if the text overflow the div and it will decrement his size until it fits!
View autosizetext.coffee
autoSizeText = ->
elements = $('.resize')
return if elements.length < 0
for el in elements
do (el) ->
resizeText = ->
elNewFontSize = (parseInt($(el).css('font-size'), 10) - 1)
$(el).css('font-size', elNewFontSize)
resizeText() while el.scrollHeight > el.offsetHeight
You can’t perform that action at this time.