This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Emails } = require('automagically'); | |
const send = async () => { | |
const email = Emails.send({ | |
from: { email: '[email protected]', name: 'AwesomeApp' }, | |
to: [{ email: '[email protected]', name: 'John Doe' }], | |
subject: 'Welcome', | |
text: 'Hey there, this is a test email!', | |
}); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const automagically = require('automagically'); | |
const testEmails = async () => { | |
const data = await automagically.emails.send({ | |
to: '[email protected]', | |
from: '[email protected]', | |
body: 'Hello, world!', | |
}); | |
console.log(data); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Services from 'tripetto-services'; | |
import { Export } from 'tripetto-runner-foundation'; | |
import { run } from 'tripetto-runner-autoscroll'; | |
const token = 'my-token-here'; | |
const config = Services.init({ token }); | |
// Picking params as spreaing the `config` does not work properly | |
const params = _.pick(config, ['definition', 'styles', 'l10n', 'locales', 'translations', 'attachments']); | |
const element = document.getElementById('my-tripetto-form'); | |
run({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example usage: | |
# NOTE: Please mind the trailing slashes at the end of the path names!!! | |
# Supports multiple files per attribute (pass them after a space - see `--add` example below: | |
# Examples: | |
# Adding: `python setFavorites.py --add file:///Users/your_username/your/path/ file:///Users/your_username/your/another_path/` | |
# Removing: `python setFavorites.py --remove file:///Users/your_username/your/path/` | |
#!/usr/bin/python | |
import os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import _ from 'lodash'; | |
export default { | |
getItem: (key, defaultValue) => { | |
if (typeof localStorage === 'undefined') return null; | |
const value = localStorage.getItem(key); | |
return _.isNil(value) ? defaultValue : JSON.parse(value); | |
}, | |
setItem: (key, data) => { | |
if (typeof localStorage === 'undefined') return null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Cache should work in a way that it takes into consideration: | |
// 1. Page number and page size | |
// 2. Applied filters | |
// Other assumptions: | |
// 1. It should be stored for up to 5 minutes - for quick access (TODO: TBD) | |
// 2. It should use localStorage | |
import _ from 'lodash'; | |
import moment from 'moment'; | |
import LS from '../../../utils/localStorage'; // Available here https://gist.github.com/Ancinek/86d2c136a04c010811d295fb2fb2deab |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Credit to https://github.com/yahoo/react-intl/issues/416#issuecomment-376088833 | |
// This is a provider that should be a direct child of <IntlProvider> from 'react-intl'. | |
// Example of wrapping the code: | |
// <IntlProvider {...someConfigProps}> | |
// <GlobalIntlProvider> | |
// <AppLayout /> | |
// </GlobalIntlProvider> | |
// </IntlProvider> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I described my problem on https://stackoverflow.com/questions/52607886/react-requests-cancellation-on-page-change/52610800#52610800 | |
// and worked my way through it | |
import _ from 'lodash'; | |
import axios from 'axios'; | |
// history should be imported from a file where it's created | |
import { history } from '../app/setup'; | |
class RequestCancelation { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Purposes: | |
// 1. For reseting a state on componentWillUnmount | |
// 2. For refetching data when :id in URL is changed | |
// It uses RequestCancellation from another gist file. More info here: | |
// https://stackoverflow.com/questions/52607886/react-requests-cancellation-on-page-change | |
import _ from 'lodash'; | |
import { connect } from 'react-redux'; | |
import { compose, lifecycle } from 'recompose'; | |
import RequestCancelation from '../services/requestCancelation'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { TweenOneGroup } from 'rc-tween-one'; | |
const defaults = { | |
durations: { | |
in: 300, | |
out: 300, | |
width: 300, | |
}, | |
easings: { |