Skip to content

Instantly share code, notes, and snippets.

@soelen
soelen / an-input.ts
Created February 4, 2023 00:14
Form Participation - Required
import { css, html, LitElement, TemplateResult } from 'lit';
import { customElement, property, query } from 'lit/decorators.js';
import { live } from 'lit/directives/live.js';
import { FormControlMixin, requiredValidator } from '@open-wc/form-control';
@customElement( 'an-input' )
export class AnInput extends FormControlMixin(LitElement) {
static formControlValidator = [requiredValidator];
static styles = css`
/** Custom styles here potentially for a design system */
import { css, html, LitElement } from 'lit-element';
import { foo } from './styles.js';
customElements.define('fancy-app', class extends LitElement {
static get styles() { return [
foo,
css`
.bar { color: pink; }
`
<?php
public function edit($id = null)
{
$page = $this->Pages->get($id, [
'contain' => []
]);
if ($this->request->is(['patch', 'post', 'put'])) {
$page = $this->Pages->patchEntity($page, $this->request->data);
if ($this->Pages->save($page)) {
$this->Flash->success(__('The page has been saved.'));
public function affe()
{
}
<?php
namespace App\Model\Table;
use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\Validation\Validator;
/**
* Images Model
<?
//Controller/PagesController.php
// at the top
use Cake\I18n\I18n;
//inside a view method, homepage
public function home()
{
I18n::locale('es');
<head>
<script type="text/javascript" src="/js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css" />
<script type="text/javascript" src="/js/bootstrap-slider.min.js"></script>
<link rel="stylesheet" type="text/css" href="/css/bootstrap-slider.min.css" /><script>
<script>
<?
$this->autoRender = false;
if($this->request->is('ajax'))
{
$day = $this->request->data('day');
$data = array(
'mister' => 'x',
'affe' => $day
);
//[...]
webfont:
{
icons:
{
src: 'font/baked/*.svg',
dest: 'app/webroot/fonts',
destCss: 'less',
options:
{
@soelen
soelen / api.js
Last active August 29, 2015 14:06
YUI.add("yuidoc-meta", function(Y) {
Y.YUIDoc = { meta: {
"classes": [],
"modules": [],
"allModules": []
} };
});