Skip to content

Instantly share code, notes, and snippets.

View roberto-butti's full-sized avatar
🚀

Roberto Butti roberto-butti

🚀
View GitHub Profile
@roberto-butti
roberto-butti / index.vue
Created August 21, 2017 21:05
Home page, index.vue
<template>
<section class="container">
<div>
<logo/>
<h1 class="title">
Nuxt.js tutorial
</h1>
<h2 class="subtitle">
Esempio di progetto Web costruito con Nuxt.js
</h2>
@roberto-butti
roberto-butti / Makefile
Last active August 17, 2017 14:01
Makefile to deploy your static Nuxtjs website on Github Pages
.PHONY: copy generate gitpush deploy
copy:
# rsync -rtvuc ./dist/ ../deploy/
rsync -rlpcgoDvzi --delete ./dist/ ../deploy/ --exclude-from 'exclude-list.txt'
gitpush:
cd ../deploy/ ;git add . ; git commit -am "deploy"; git push -u origin master; cd -
@roberto-butti
roberto-butti / app.js
Created May 30, 2017 05:11
Register a vue component
if (module.hot)
module.hot.accept()
import Vue from 'vue'
Vue.component('timer', require('./components/Timer.vue'));
new Vue({
el: "#app",
data: {
@roberto-butti
roberto-butti / index.html
Created May 30, 2017 05:07
custom element Vue Component
<!DOCTYPE html>
<html>
<head>
<title>Tomato</title>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.4.2/css/bulma.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<div id="app">
<h1>{{ name }}</h1>
@roberto-butti
roberto-butti / Timer.vue
Created May 30, 2017 05:04
Sample Vue Component
<template>
<div class="wrapper">
<span class="timer">{{ timerFormatted }}</span>
<div class="actions">
<button @click="start">Start</button>
<button @click="stop">Stop</button>
<button @click="reset">Reset</button>
</div>
</div>
</template>
@roberto-butti
roberto-butti / webpack.config.js
Created May 29, 2017 19:57
webpack configuration file for Vue Loader
// VUE-LOADER: loading module Vue
const vue = require('vue-loader');
const path = require('path');
const webpack = require('webpack');
module.exports = {
context: path.resolve(__dirname, 'src'),
entry: {
app: './app.js',
},
output: {
@roberto-butti
roberto-butti / users.php
Created May 24, 2017 12:31
Users.php is the representation of a model (User) in the admin interface.
<?php
return array(
'title' => 'Users',
'single' => 'user',
'model' => 'App\User',
/**
* The display columns
*/
'columns' => array(
@roberto-butti
roberto-butti / example_com.conf
Created May 4, 2017 17:26
Nginx virtual host configuration with PHP (Ubuntu server)
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/example.com/htdocs/public;
index index.php index.html index.htm index.nginx-debian.html;
server_name example.com www.example.com;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
@roberto-butti
roberto-butti / create_usb_boot_install_ubuntu.sh
Created April 30, 2017 06:12
Create USB bootable installer for Ubuntu
#replace sdX with your device. THIS COMMAND WILL DESTROY THE CONTENT OF YOUR DEVICE (/dev/sdX)
sudo umount /dev/sdX1
sudo dd if=ubuntu-17.04-desktop-amd64.iso of=/dev/sdX bs=4M
sync
@roberto-butti
roberto-butti / webpack.config.js
Created March 31, 2017 12:21
Minimal Webpack config file
const path = require('path');
const webpack = require('webpack');
module.exports = {
context: path.resolve(__dirname, 'src'),
entry: {
app: './app.js',
},
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: '/dist/',