Skip to content

Instantly share code, notes, and snippets.

View jamieallen59's full-sized avatar

Jamie Allen jamieallen59

View GitHub Profile
@jamieallen59
jamieallen59 / SomeComponent.js
Created February 9, 2017 11:22
Potential SCSS structure
import React from 'react';
// exported to be used in .test file
export default className = 'someComponent';
const SomeComponent = () => (
<div className={className}>
<h1 className={`${className}__mainHeader`}>My Header</h1>
<p className={`${className}__randomParagraph`}>
Some very interesting text
import { fromPromise } from 'rxjs/observable/fromPromise';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/switchMap';
// IGNORE (just filters)
const isValidLinkedAccount = linkedAccount => {
const { is_linked: isLinked, link_failed: linkFailed, status, service_status: serviceStatus } = linkedAccount;
return isLinked && !linkFailed && status === 'active' && serviceStatus === 'active';
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@jamieallen59
jamieallen59 / mergeMessages.js
Last active March 19, 2019 13:35
script to merge files together for react-intl
const fs = require('fs')
const globSync = require('glob').sync
const DEFAULT_LANGUAGE = 'en'
const MESSAGES_PATTERN = './build/messages/**/*.json'
const WRITE_PATH = './src/localeData.json'
const TRANSLATIONS_PATTERN = './public/locales/*.json'
// Takes a filename: ./public/locales/it.json
// Returns the locale: it