Skip to content

Instantly share code, notes, and snippets.

@anwas
anwas / dev-functions.php
Last active May 7, 2021 09:38
[DEV functions] Functions list #php #function #dev
<?php
/**********************************************************************
* ***
* Konstanta ABSPATH naudoja funkcijose su failo operacijomis
*********************************************************************/
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', dirname( __FILE__, 5 ) ); // svetainės root aplankas (pritaikyti pagal projektą) (web)
}
setlocale( LC_ALL, ['lt_LT.UTF-8', 'lt_LT', 'lt'] );
@anwas
anwas / helpers.class.php
Last active October 10, 2020 00:50
[Helpers functions class]
<?php
/**
* Anwp_Debug_Helpers class
*
* @package Anwp_App
*/
declare( strict_types = 1 );
namespace Anwp_App;
@anwas
anwas / Gulpfile.js
Last active November 30, 2018 19:46
[HTML Dev workflow]
var homeRoot = '../../',
srvRoot = homeRoot + 'www_srv/';
var site_00_Name = 'html',
site_00_Prefix = 'html',
site_00_Root = srvRoot + site_00_Name + '/',
site_00_Assets = site_00_Root + 'assets/',
site_00_SrcRoot = site_00_Assets + '_src/';
@anwas
anwas / functions.php
Created January 31, 2018 00:29
[WordPress Include custom template] #wordpress #template #php
<?php
/*
* Include Custom Templates
*************************************************************************** */
function my_custom_template( $template ) {
// patikrinama ar rodomas puslapis yra pasirinktinio tipo įrašų archyvas
if ( ! is_admin() && is_post_type_archive( 'custom-post-type' ) ) {
// įtraukiami reikiami stiliai ir scenarijai
add_action( 'wp_enqueue_scripts', 'my_custom_styles' );
add_action( 'wp_enqueue_scripts', 'my_custom_scripts' );
@anwas
anwas / template.sublime-project
Last active February 22, 2018 09:07
[SublimeText project TEMPLATE for WordPress] #sublimetext #wordpress #template
{
"folders":
[
{
"name": "THEMES",
"path": "/home/anwas/www_srv/clients/client1/konferencija.pavb.lt/web/wp-content/themes"
},
{
"name": "PLUGINS",
"path": "/home/anwas/www_srv/clients/client1/konferencija.pavb.lt/web/wp-content/plugins"
@anwas
anwas / parallax.html
Last active October 10, 2019 06:27
[Full screen vertically scrolling parallax] #css #parallax #scrolling
<!-- https://www.w3schools.com/howto/howto_css_parallax.asp -->
<style>
body, html {
min-height: 100vh;
}
.parallax {
/* The image used */
background-image: url("img_parallax.jpg");
@anwas
anwas / Gulpfile.js
Last active November 30, 2018 19:46
[WordPress Dev workflow]
var siteUrl = 'wp.lanbox.lt',
urlProtocol = 'http://',
secureUrl = false,
portNumber = 8888,
reloadDelayMiliseconds = 700;
var homeRoot = '../../',
srvRoot = homeRoot + 'www_srv/',
sitesRoot = srvRoot + 'clients/client1/',
wpContent = sitesRoot + siteUrl + '/web/wp-content/',
@anwas
anwas / wc-variation-dropdown-text.php
Last active February 22, 2018 09:05
[WC Variation Dropdown Text] #wordpress #woocommerce #plugins #php
<?php
/**
* Plugin Name: WC Variation Dropdown Text
* Plugin URI: http://gelazius.eu
* Description: WC Variation Dropdown Text plugin replaces the default WooCommerce variation text from "Choose an option" to the current attribute title.
* Version: 1.0
* Author: Vytenis Gelažius
* Author URI: http://gelazius.eu
**/
@anwas
anwas / lt-LT
Last active February 23, 2018 09:06
[PO wordpress šablono kodai] #poedit #translate #wordpress
__
_e
_c
__ngettext:1,2
_n:1,2
_nc:1,2
__ngettext_noop:1,2
_n_noop:1,2
_x:1,2c
_nx:1,2,4c
@anwas
anwas / css-growing-underline.css
Created February 23, 2018 09:55
[CSS Animated Underline Links (Growing underline)] #css #links #animation
a {
text-decoration: none;
position: relative;
color: #3366FF;
padding: 0 1em 0.125em;
}
a:after {
content: '';
position: absolute;
bottom: 0;