Skip to content

Instantly share code, notes, and snippets.

View iam4x's full-sized avatar
🐧

iam4x iam4x

🐧
View GitHub Profile
@iam4x
iam4x / react-intl-wrapper.js
Created August 25, 2015 18:12
Catch missing translations from `react-intl`
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 / connectToStores.md
Last active October 9, 2015 22:29
`connectToStores` decorator for https://github.com/goatslacker/alt

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 }
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º
<?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>
@iam4x
iam4x / custom-header-menu.js
Created November 9, 2017 15:55
custom-header-menu.js
const search = instantsearch(/* parameters */);
const categoriesToShow = [
'hombres',
'mujeres',
'ninos',
'calzado',
'accesorios',
'marcas',
'reviews'
<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 / autosizetext.coffee
Last active August 2, 2018 19:36
I wrote this simple function in CoffeeScript which tests if the text overflow the div and it will decrement his size until it fits!
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
// @flow
/* eslint no-redeclare: off */
/* eslint no-use-before-define: off */
/**
* API Mailers
*/
declare function use(module: 'App/Mailers/Base'): Class<api$BaseMailer>;
// @flow
/* eslint no-redeclare: off */
/* eslint no-use-before-define: off */
declare type adonis$UntypedModules =
| 'Context/Manager'
| 'Route'
| '@adonisjs/fold'
| 'App/Initializers/Validators/boot'
@iam4x
iam4x / cloudSettings
Created October 31, 2019 00:28
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-10-31T00:28:04.459Z","extensionVersion":"v3.4.3"}