Skip to content

Instantly share code, notes, and snippets.

View petervmeijgaard's full-sized avatar
🎸
Rocking!

Peter van Meijgaard petervmeijgaard

🎸
Rocking!
View GitHub Profile
@petervmeijgaard
petervmeijgaard / todo-vue-example.html
Last active September 13, 2017 05:24
Todo Vue.js Example
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Todo Vue.js Example</title>
<link rel="stylesheet"
type="text/css"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://cdn.jsdelivr.net/vue/latest/vue.js"></script>
<style type="text/css">
@petervmeijgaard
petervmeijgaard / gulpfile.js
Last active December 16, 2015 11:55
Example Gulpfile
'use strict';
var gulp = require('gulp');
var stylus = require('gulp-stylus');
var sourcemaps = require('gulp-sourcemaps');
var prefix = require('gulp-autoprefixer');
var minifyCss = require('gulp-minify-css');
var rename = require('gulp-rename');
var browserSync = require('browser-sync');
@petervmeijgaard
petervmeijgaard / .gvimrc
Last active August 16, 2016 12:55
Development configuration
set macligatures
"Disable Command + P
if has("gui_macvim")
macmenu &File.Print key=<nop>
endif
@petervmeijgaard
petervmeijgaard / webpack.config.js
Last active August 9, 2016 15:30
webpack.config.js
var webpack = require('webpack')
var path = require('path')
module.exports = {
entry: './src/index.js',
output: {
path: './dist/',
filename: 'index.js',
library: 'VueComponents',
libraryTarget: 'umd'
@petervmeijgaard
petervmeijgaard / elixir.json
Created July 20, 2016 21:11
Laravel elixir problem
{
"stylus": {
"input": "./resources/area/frontend/stylus/app.styl",
"output": "public/frontend/css/app.css"
},
"version": {
"input": [
"public/frontend/css/app.css"
],
"output": "./public/frontend/build"
@petervmeijgaard
petervmeijgaard / loader.js
Created July 30, 2016 09:59
Webpack Vue File Loader
export default {
file(file, async = false) {
console.log(file);
if (async) {
return (resolve) => {
require([`${file}`], resolve);
};
}
@petervmeijgaard
petervmeijgaard / keybase.md
Created September 15, 2016 11:37
keybase.md

Keybase proof

I hereby claim:

  • I am petervmeijgaard on github.
  • I am petervmeijgaard (https://keybase.io/petervmeijgaard) on keybase.
  • I have a public key ASAe841CdWHVGt4RkG3Hjd5uxy2dcaIxAN6wZvtM75Nvngo

To claim this, I am signing this object:

@petervmeijgaard
petervmeijgaard / Todo.spec.js
Created September 18, 2017 15:21
Testing Vue components
import { shallow } from 'vue-test-utils'
import sinon from 'sinon'
import Todo from '@/components/Todo'
describe('Todo.vue', () => {
/**
* Test will check if the name of the component is todo.
*/
it('Is called todo', () => {
// Initialize the test.
@petervmeijgaard
petervmeijgaard / PostController_v1.php
Created September 11, 2018 17:39
My take on the Repository Pattern
<?php
namespace App\Http\Controllers;
use Illuminate\Http\JsonResponse;
use App\Repositories\Contracts\PostRepository;
class PostController extends Controller
{
/**
@petervmeijgaard
petervmeijgaard / objectToDotNotation.js
Last active June 14, 2021 08:03
Recursive Object to Dot Notation Helper
const isObject = value => typeof value === 'object' && value !== null && !Array.isArray(value);
const getDottedKey = (current, parent = null) => (parent ? `${parent}.${current}` : current);
const objectToDotNotation = (value, key = null, carry = {}) => {
if (!isObject(value) && !key) {
return value;
}
if (!isObject(value)) {