Skip to content

Instantly share code, notes, and snippets.

@lukepolo
lukepolo / VendorInjectionPlugin.js
Created December 27, 2019 20:10 — forked from MrBr/VendorInjectionPlugin.js
Webpack plugin for importing split library bundles within CRA environment.
const fs = require('fs');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
// Used to replace vendor imports with empty string
const ConstDependency = require('webpack/lib/dependencies/ConstDependency');
function hashString(str) {
var hash = 0,
i,
chr;
import NProgress from "nprogress";
window.NProgress = NProgress;
export default function loadProgressBar(config) {
let timeoutSet = false;
let requestsCounter = 0;
let spinnerTimeout = null;
const setupStartProgress = () => {
axios.interceptors.request.use((config) => {
@lukepolo
lukepolo / valet.conf
Created March 23, 2019 17:49 — forked from poul-kg/valet.conf
CORS Rules for Laravel Valet Nginx
# To enable CORS you should add lines with CORS rules below to your valet.conf file
# Find the file /usr/local/etc/nginx/valet/valet.conf - this is Valet conf for Nginx
# of try to execute `locate valet.conf` and find the `valet.coinf` in `nginx` subdirectory
# after you edit your valet.conf do not forget to execute `valet restart`
server {
listen 80 default_server;
root /;
charset utf-8;
client_max_body_size 128M;
const path = require("path");
const VarieBundler = require("varie-bundler");
const ENV = require("dotenv").config().parsed;
module.exports = function(env, argv) {
return new VarieBundler(argv, __dirname)
.entry("app", ["resources/js/app/app.ts", "resources/sass/app.scss"])
.aliases({
"@app": path.join(__dirname, "resources/js/app"),
"@views": path.join(__dirname, "resources/js/views"),
"@store": path.join(__dirname, "resources/js/store"),
{
mode: 'development',
context: '/Users/luke/Code/opensource/varie/varie',
devtool: 'eval-source-map',
stats: {
hash: false,
chunks: false,
modules: false,
source: false,
reasons: false,
{
"authHost": "https://codepier.io",
"authEndpoint": "/broadcasting/auth",
"clients": [
{
"appId": "keyhere",
"key": "keyhere"
}
],
"database": "redis",

Keybase proof

I hereby claim:

  • I am lukepolo on github.
  • I am lukepolo (https://keybase.io/lukepolo) on keybase.
  • I have a public key ASAKAKZfk9QeISdkwZXXfa-M0RQzuOXI3ZlrP_nnRF_DhQo

To claim this, I am signing this object:

@lukepolo
lukepolo / Article.php
Last active February 17, 2017 21:55
Current Revision Query
<?php
/**
* The problem : i want to retrieve articles with their current revision of the status of Pending.
*
* Go to the controller, see that im using the scope of `hasType`, follow through into the article model
* you will see that we are using a `whereHas` . Whats funny is its working in the fact if `NONE` of the article revisions
* have a status of pending it works! But if `1` has a status of `pending` it will return the latest revision even if its not
* pending
*/
{
"private": true,
"scripts": {
"dev": "cross-env NODE_ENV=development webpack --progress --hide-modules",
"watch": "cross-env NODE_ENV=development webpack --watch --progress --hide-modules",
"hmr": "cross-env NODE_ENV=development webpack-dev-server --inline --hot",
"production": "cross-env NODE_ENV=production webpack --progress --hide-modules"
},
"devDependencies": {
"cross-env": "^3.1.4",
@lukepolo
lukepolo / Error.js
Last active February 28, 2017 16:00
Helper Classes for Vue.js / Vuex / Vue-Router
//https://github.com/laracasts/Vue-Forms/blob/master/public/js/app.js
class Errors {
/**
* Create a new Errors instance.
*/
constructor() {
this.errors = {};
}