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 path = require('path'); | |
| const mode = process.env.NODE_ENV === 'dev' || process.env.NODE_ENV === 'test' ? 'development' : 'production'; | |
| module.exports = { | |
| target: 'node', | |
| mode: mode, | |
| entry: __dirname + '/src/index.js', | |
| devtool: 'inline-source-map', | |
| resolve: { | |
| extensions: [ '.js' ] |
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
| "scripts": { | |
| "test": "jest", | |
| "build": "NODE_ENV=production webpack --mode production", | |
| "dev": "NODE_ENV=dev webpack --progress --colors --watch" | |
| }, |
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 Weather = require('./weather'); | |
| const weather = new Weather(); | |
| weather.getWeatherByCity('sydney').then(result => { | |
| console.log(result); | |
| }) |
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 axios = require('axios'); | |
| const groupBy = require('lodash/groupBy'); | |
| class Weather { | |
| constructor() { | |
| this.endpoint = 'https://www.metaweather.com/api'; | |
| } | |
| groupByDates(weather) { | |
| return groupBy(weather, (item) => item.applicable_date); |
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, { PropTypes } from 'react'; | |
| import styled from 'styled-components' | |
| const Wrapper = styled.div` | |
| // styles here that used to be for .test | |
| ` | |
| const Label = styled.label` | |
| // label styles here | |
| ` |
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
| #301 Redirects for .htaccess | |
| #Redirect a single page: | |
| Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
| #Redirect an entire site: | |
| Redirect 301 / http://www.domain.com/ | |
| #Redirect an entire site to a sub folder | |
| Redirect 301 / http://www.domain.com/subfolder/ |
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
| function slugify(text) | |
| { | |
| return text.toString().toLowerCase() | |
| .replace(/\s+/g, '-') // Replace spaces with - | |
| .replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
| .replace(/\-\-+/g, '-') // Replace multiple - with single - | |
| .replace(/^-+/, '') // Trim - from start of text | |
| .replace(/-+$/, ''); // Trim - from end of text | |
| } |
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
| <?php | |
| namespace Bolt\Extension\DesignSpike\ExampleSearch; | |
| use Bolt\Extension\SimpleExtension; | |
| use Bolt\Routing\ControllerCollection; | |
| use Doctrine\DBAL\Query\QueryBuilder; | |
| use Silex\Application; | |
| use Symfony\Component\HttpFoundation\Request; | |
| use Symfony\Component\HttpFoundation\Response; |
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 Dockerfile | |
| FROM hello-world |
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
| docker cp cmsdrupalmultisite_web_1:/var/www/html/sites/sergiofranco.com.br ~/ornitoprojects/docker-cms-multisite |