Skip to content

Instantly share code, notes, and snippets.

View avosalmon's full-sized avatar

Ryuta Hamasaki avosalmon

View GitHub Profile
@avosalmon
avosalmon / .gitignore-api-laravel
Last active August 29, 2015 14:14
.gitignore for laravel api
/bootstrap/compiled.php
/app/storage/downloads
/app/storage/uploads
/app/storage/sessions/*
/app/storage/cache/*
/app/storage/logs
/app/config/database.php
/app/config/pubnub.php
vendor/.git
vendor/**/composer.lock
@avosalmon
avosalmon / .gitignore-module-laravel
Last active August 29, 2015 14:14
.gitignore for laravel module
/vendor
/node_modules
/ruby_vendor
/.bundle
composer.phar
.DS_Store
Thumbs.db
.tmp
npm-debug.log
@avosalmon
avosalmon / .gitignore-angular
Last active August 29, 2015 14:14
.gitignore for angular ui/module
/bower_components
/node_modules
/ruby_vendor
/.bundle
/.sass-cache
.tmp
.DS_Store
Thumbs.db
npm-debug.log
@avosalmon
avosalmon / gist:360f2a210ab94366601f
Last active August 29, 2015 14:14
Todo list for adding a new app or module
  1. create a new github repository
  2. git init
  3. git checkout -b integration
  4. git add -A .
  5. git commit -m "initial commit"
  6. git remote add origin git@github.com:kurashicom/repo_name.git
  7. git push -u origin integration
  8. create a new hipchat room for github notifiation
  9. create a new room for hipchat
  10. add web hook in the github
@avosalmon
avosalmon / ProductController.php
Last active December 6, 2018 05:44
ProductController before refactoring
<?php
class ProductController extends Controller
{
public function show($id)
{
$product = $this->products->findOrFail($id);
$data = [
'head' => $this->generateHeadTagsArray([
@avosalmon
avosalmon / ProductController.php
Created December 4, 2018 14:49
ProductController after refactoring
<?php
class ProductController extends Controller
{
public function show($id)
{
$product = $this->products->findOrFail($id);
return ProductResponse($product);
}
<?php
use Illuminate\Contracts\Support\Responsable;
class ProductResponse implements Responsable
{
/**
* Create new instances for dependencies.
*
* @param $product
@avosalmon
avosalmon / default-webpack.mix.js
Created December 14, 2018 11:22
Laravel Mix default config
const mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.
@avosalmon
avosalmon / upload-s3-webpack.mix.js
Last active July 9, 2022 18:24
Upload assets to S3 using Laravel Mix
const mix = require('laravel-mix');
const s3Plugin = require('webpack-s3-plugin');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
@avosalmon
avosalmon / versioning-webpack.mix.js
Last active December 14, 2018 11:50
Cache busing with Laravel Mix
const mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel application. By default, we are compiling the Sass
| file for the application as well as bundling up all the JS files.