Skip to content

Instantly share code, notes, and snippets.

View victorkurauchi's full-sized avatar
🎯
Focusing

Victor Kurauchi victorkurauchi

🎯
Focusing
View GitHub Profile
@victorkurauchi
victorkurauchi / webpack.config.js
Last active December 29, 2018 11:03
webpack.config.js
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' ]
@victorkurauchi
victorkurauchi / package.json
Last active January 8, 2019 01:56
package.json
"scripts": {
"test": "jest",
"build": "NODE_ENV=production webpack --mode production",
"dev": "NODE_ENV=dev webpack --progress --colors --watch"
},
@victorkurauchi
victorkurauchi / weather-consumer.js
Created December 29, 2018 03:09
weather-consumer.js
const Weather = require('./weather');
const weather = new Weather();
weather.getWeatherByCity('sydney').then(result => {
console.log(result);
})
@victorkurauchi
victorkurauchi / weather.js
Last active January 4, 2019 05:32
weather.js
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);
@victorkurauchi
victorkurauchi / Field.js
Created November 21, 2018 00:12 — forked from mxstbr/Field.js
Style Storybook with Styled Components
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
`
@victorkurauchi
victorkurauchi / .htaccess
Created May 14, 2018 15:10 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#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/
@victorkurauchi
victorkurauchi / slugify.js
Created May 11, 2018 13:51 — forked from mathewbyrne/slugify.js
Javascript Slugify
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
}
@victorkurauchi
victorkurauchi / ExampleSearchExtension.php
Created May 8, 2018 01:41 — forked from use/ExampleSearchExtension.php
Example of how to create a custom search feature for the Bolt CMS, by making a local extension
<?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;
@victorkurauchi
victorkurauchi / Dockerfile
Created March 23, 2018 15:33 — forked from yefim/Dockerrun.aws.json
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
# Example Dockerfile
FROM hello-world
@victorkurauchi
victorkurauchi / docker
Created February 28, 2018 21:07
moving folder from container to host
docker cp cmsdrupalmultisite_web_1:/var/www/html/sites/sergiofranco.com.br ~/ornitoprojects/docker-cms-multisite