Skip to content

Instantly share code, notes, and snippets.

View certainlyakey's full-sized avatar

Aleksandr Beliaev certainlyakey

  • Nortal AS
  • Tallinn
View GitHub Profile
@stianandreassen
stianandreassen / acf_wysiwyg_height.php
Last active January 24, 2022 22:35
Add a height field to ACF WYSIWYG Field
<?php
/**
* Add height field to ACF WYSIWYG
*/
function wysiwyg_render_field_settings( $field ) {
acf_render_field_setting( $field, array(
'label' => __('Height of Editor'),
'instructions' => __('Height of Editor after Init'),
'name' => 'wysiwyg_height',
'type' => 'number',
@stepango
stepango / keyboard.lua
Last active January 7, 2024 18:01
Hammerspoon change layout from Russian to English
ctrlPressed = false
keyPressed = false
layoutWatcher = hs.eventtap.new({hs.eventtap.event.types.flagsChanged, hs.eventtap.event.types.keyUp}, function(e)
local flags = e:getFlags()
local keyCode = e:getKeyCode()
if flags.cmd and keyCode == 0x36 and not (flags.alt or flags.shift or flags.ctrl or flags.fn) then
ctrlPressed = true
keyPressed = false
elseif ctrlPressed and not (flags.cmd or flags.alt or flags.shift or flags.ctrl or flags.fn) and not keyPressed then
@anthonyeden
anthonyeden / wordpress-date.php
Last active May 8, 2023 07:38
Wordpress Date() and StrToTime() Functions
<?php
function wp_date_localised($format, $timestamp = null) {
// This function behaves a bit like PHP's Date() function, but taking into account the Wordpress site's timezone
// CAUTION: It will throw an exception when it receives invalid input - please catch it accordingly
// From https://mediarealm.com.au/
$tz_string = get_option('timezone_string');
$tz_offset = get_option('gmt_offset', 0);
@jhades
jhades / 01.ts
Last active July 22, 2022 13:48
ng-template, ng-container and ngTemplateOutlet examples
@Component({
selector: 'app-root',
template: `
<ng-template>
<button class="tab-button"
(click)="login()">{{loginText}}</button>
<button class="tab-button"
(click)="signUp()">{{signUpText}}</button>
</ng-template>
@jwalanta
jwalanta / OpenWrt detect new device and send text message.md
Last active February 10, 2024 09:16
Detect new network devices connecting to OpenWrt and send text message
@zeshanshani
zeshanshani / acf_options_multilingual.php
Last active October 10, 2023 11:25
Creates separate Advanced Custom Fields options pages for the specified languages.
<?php // Don't copy this line if you are inserting in a file that has it already.
/**
* ACF Options Page
*
* Instructions:
* Add more languages to the array below: $languages
*
* @author: Zeshan Ahmed <https://zeshanahmed.com/>
*/
@kellenmace
kellenmace / save-gravity-forms-file-upload-to-advanced-custom-fields-field-in-wordpress.php
Last active March 2, 2018 03:48
Save Gravity Forms File Upload to Advanced Custom Fields Field in WordPress
<?php
/**
* Save Gravity Forms event registration file to media library.
*/
class WDSP_Event_Form {
/**
* Instance of class.
*
* @var class
@derekshirk
derekshirk / acf-inline-svg.php
Created July 20, 2016 22:14
Output Inline SVGs from ACF image field
<?php
/* ————————————————————————— */
/* ACF Inline SVGs
/* ————————————————————————— */
$repeater = 'repeater_field_name'
if ( have_rows( $repeater ) ): ?>
<section class="content-main">
<div class="container"> <?php
@pdanford
pdanford / README.md
Last active April 13, 2024 18:19
Launching iTerm2 from macOS Finder

Launching iTerm2 from macOS Finder

(Based on info from Peter Downs' gitub but with modified behavior to open a new terminal window for each invocation instead of reusing an already open window.)

The following three ways to launch an iTerm2 window from Finder have been tested on iTerm2 version 3+ running on macOS Mojave+.

pdanford - April 2020


//Deregister Gravity Stylesheets and Scripts from specific pages
add_action("gform_enqueue_scripts", "deregister_scripts");
function deregister_scripts(){
//Change this conditional to target whatever page or form you need.
if(is_front_page()) {