This script implements some of PHP's magic methods for JavaScript classes, using a Proxy.
You can use it like this:
const Foo = magicMethods(class Foo {
constructor () {
this.bar = 'Bar'
}
This script implements some of PHP's magic methods for JavaScript classes, using a Proxy.
You can use it like this:
const Foo = magicMethods(class Foo {
constructor () {
this.bar = 'Bar'
}
/** | |
* @param {string} id | |
* @param {string} form | |
*/ | |
function Gerador (id, form) | |
{ | |
this.__id = id | |
this.__form = form || 'formUsuario' | |
/** |
<script> | |
import c3 from 'c3' | |
import { debounce, cloneDeep, defaultsDeep } from 'lodash' | |
export default { | |
name: 'c3-chart', | |
props: { | |
config: { | |
type: Object, | |
default: () => ({}) |
<?php | |
final class DiggStylePagination { | |
/** | |
* DiggStylePagination::create(5, 1, 15, function($page){ return 'http://localhost/' . $page; }) | |
* | |
* | |
*/ | |
public final static function create($currentPage, $firstPage, $totalPages, \Closure $url, $adjacents = 1, array $classes = []) { |
export function pis (PIS) { | |
if (PIS === '' || PIS === null) { | |
return false | |
} | |
if (String(PIS).match(/(\d)\1{9}/g)) { | |
return false | |
} | |
PIS = String(PIS).replace(/\D+/g, '') | |
const pesos = [3, 2, 9, 8, 7, 6, 5, 4, 3, 2] | |
let soma = 0 |
#!/bin/sh | |
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$") | |
ESLINT="$(git rev-parse --show-toplevel)/node_modules/.bin/eslint" | |
if [[ "$STAGED_FILES" = "" ]]; then | |
exit 0 | |
fi | |
PASS=true |
<template> | |
<div class="container-fluid"> | |
<form> | |
<div class="row"> | |
<div class="col-md-6"> | |
<div class="form-group" v-bind:class="{ 'has-error': $v.form.name.$error }"> | |
<label class="control-label" for="name">Nome completo* :</label> | |
<input type="text" v-model="form.name" v-on:input="$v.form.name.$touch" v-on:blur="$v.form.name.$touch" | |
v-bind:class="{error: $v.form.name.$error, valid: $v.form.name.$dirty && !$v.form.name.$invalid}" |
* { box-sizing: border-box; } | |
html, body { min-height: 100vh; margin: 0; } | |
div, | |
html, | |
body, | |
nav, | |
header, | |
hgroup, | |
footer, |
const requestQuery = request => { | |
const param = request.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]") | |
const regex = new RegExp("[\\?&]" + param + "=([^&#]*)") | |
const results = regex.exec(location.search); | |
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")) | |
} | |
// caso de uso |