Skip to content

Instantly share code, notes, and snippets.

View ktquez's full-sized avatar
:octocat:
Creating cool and open source stuff

Alan Ktquez ktquez

:octocat:
Creating cool and open source stuff
View GitHub Profile
@ktquez
ktquez / session_form_simple.php
Last active June 18, 2023 19:27
session_form_simple.php
<?php
session_start(); // inicia a sessão
if(isset($_SESSION['form'])){
$_SESSION['form'] = array_merge($_SESSION['form'], filter_input_array(INPUT_POST)); // se existir, ele unifica os arrays
}else{
$_SESSION['form'] = filter_input_array(INPUT_POST); // se não existir, ele inicializa
}
var_dump($_SESSION['form']); // dá uma saída de como está ficando o array na session (serve somente de exemplo)
@ktquez
ktquez / Alert.vue
Created May 5, 2016 19:41 — forked from laracasts/Alert.vue
Alert .vue example.
<template>
<div class="Alert Alert--{{ type | capitalize }}">
<slot></slot>
</div>
</template>
<script>
export default {
props: {
type: {
"devDependencies": {
"autoprefixer": "^6.3.6",
"browser-sync": "^2.12.3",
"cssnext": "^1.8.4",
"csswring": "^4.2.2",
"gulp-postcss": "^6.1.0",
"postcss-nested": "^1.0.0",
"gulp": "^3.9.1",
"gulp-clean": "^0.3.2",
"gulp-cli": "^1.2.1",
var gulp = require('gulp');
var postcss = require('gulp-postcss');
var inject = require('gulp-inject');
var watch = require('gulp-watch');
var clean = require('gulp-clean');
var concat = require('gulp-concat');
var cssnext = require('cssnext');
var csswring = require('csswring');
var browserSync = require('browser-sync');
var prefix = require('autoprefixer');
@ktquez
ktquez / exemple.package.json
Last active May 11, 2016 22:47
Exemple of dependencies in package.json for build apps with Vue.js and webpack
"devDependencies": {
"babel-core": "^6.8.0",
"babel-loader": "^6.2.4",
"babel-plugin-transform-runtime": "^6.8.0",
"babel-preset-es2015": "^6.6.0",
"babel-preset-stage-0": "^6.5.0",
"babel-runtime": "^6.6.1",
"browser-sync": "^2.12.7",
"browser-sync-webpack-plugin": "^1.0.1",
"css-loader": "^0.23.1",
// rm -rf ./build && webpack --config webpack.prod.config.js -p --progress
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ROOT = __dirname;
var PROJECT_ROOT = path.join(ROOT, 'src');
var BUILD_ROOT = path.join(ROOT, 'build');
@ktquez
ktquez / home.js
Created May 27, 2016 02:16 — forked from dewey92/home.js
Vue router
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
Vue.use(require('vue-resource'))
const router = new VueRouter({
history : true,
saveScrollPosition: true
});
slug (value) {
const mapLetters = {
a: /(á|ã|â|à)/g,
e: /(é|ê)/g,
i: /(í)/g,
o: /(ó|ô|õ)/g,
u: /(ú)/g,
c: /(ç)/g,
n: /(ñ)/g
}
@ktquez
ktquez / my-component.js
Last active August 7, 2016 05:05
Vue-head in ES6 to use in component scope
import { vueHead } from '/path/to/plugin/vue-head-es6'
export default {
// use extends with vue v1.0.22+
extends: vueHead
// use mixins with vue v1.0.21-
// mixins: [head]
data () {
return {
//...