Skip to content

Instantly share code, notes, and snippets.

View olenkadark's full-sized avatar
🎯
Focusing

Olena ZHyvohliad olenkadark

🎯
Focusing
View GitHub Profile
@olenkadark
olenkadark / gist:592add8bfb53a45d9399ff9074e81cca
Created July 10, 2024 10:42
Directive to show a loader until the image is ready in AngularJS
angular.module('app', [])
.directive('onFinishRender', function ($timeout) {
return {
restrict: 'A',
link: function (scope, element, attr) {
element.attr('style', 'display:none'); // hide the image until it's loaded
element.on('load', function () {
element.attr('style', '');
$timeout(function () {
scope.$emit('ngOnFinishRender')
<?php
class DateTasks{
/**
* @param string $period
*
* @return false|string
*/
public static function getPasteDate($period){
<?php
/*
This script will allow you to send a custom email from anywhere within wordpress
but using the woocommerce template so that your emails look the same.
Created by [email protected] on 27th of July 2017
Put the script below into a function or anywhere you want to send a custom email
*/
<?php
/**
* Form Functions
*
* @author Elena ZH
* @category Core
* @package Functions
* @version 1.1.5
*/
if ( ! defined( 'ABSPATH' ) ) {
@olenkadark
olenkadark / protect.php
Last active April 21, 2024 05:11
Protect Your WordPress Admin Area. Hide your WP Admin URL. Secure your WordPress website by protecting the login page and preventing brute force attacks. Put this file to mu-plugins directory
<?php
/**
* Protect Your WordPress Admin Area
*
* Hide your WP Admin URL.
* Secure your WordPress website by protecting the login page and preventing brute force attacks
*/
define( 'U_RESTRICT_USERS', true);
define( 'WP_ADMIN_DIR', 'dashboard');