Skip to content

Instantly share code, notes, and snippets.

// shortcode
[recent_products per_page="6" columns="6" orderby="rand" order="rand"]
// app.module.ts
import { LOCALE_ID } from '@angular/core';
import { registerLocaleData } from '@angular/common';
import localeDe from '@angular/common/locales/de';
registerLocaleData(localeDe);
providers: [
[{ provide: LOCALE_ID, useValue: 'de-DE'}]
],
// html
<button (click)="methodName()">Btn text</button>
<p>{{ newPost }}</p>
// ts
export class className {
newPost='';
methodName() {
this.newPost = 'some text';
// html
<textarea rows="6" [value]="newPost"></textarea> // property is element property written in []
<button (click)="methodName()">Btn text</button>
// ts
export class className {
newPost='predefined text for textarea';
methodName() {
// do something
// model
// ts
export interface Post {
// some data for example
title: string;
content: string;
}
// service
// ts
<?php
$args = array(
'post_type' => 'product',
'product_cat' => 'klaviere',
'posts_per_page' => 3,
'orderby' => 'date',
'order' => 'DESC'
);
$loop = new WP_Query($args);
while ($loop->have_posts()) : $loop->the_post();
// place in template
do_action( 'tuttner_show_payment_options' );
// place in functions.php
add_action( 'tuttner_show_payment_options', 'woocommerce_checkout_payment', 20 );
// this example is for custom placing a payment options
var overviewPageUrl = '@Model.Content.Url';
var overviewPageUrl = '@Model.Content.Parent.Url';
var detailPageUrl = '@Model.Content.Children.SingleOrDefault(node => node.DocumentTypeAlias == "MDArticleLocalDetailPage").Url';
$('#saveNewTasklist').on("click", function () {
const nestedQuery = '.nested-sortable';
const identifier = 'taskId';
const root = document.getElementById('tasks');
function serialize(tasks) {
var serialized = [];
var children = [].slice.call(tasks.children); // children == document property
/**
* [].slice.call() == Array.prototype.slice.call()
*
@ABooooo
ABooooo / Refs
Last active June 19, 2024 11:46
<template>
<p>{{ text }}</p>
</template>
<script setup>
import { ref } from 'vue'
const text = ref('juhu')
</script>