This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
no-resolv | |
proxy-dnssec | |
server=::1#5353 | |
server=127.0.0.1#5353 | |
listen-address=::1,127.0.0.1 | |
# Put any other line here like laravel valet using .test domain. | |
address=/.test/127.0.0.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Utkarsh\Attachment\Meta; | |
const META_NAME = 'media_credit'; | |
/** | |
* Bootstrap. | |
*/ | |
function bootstrap() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery( document ).ready( function () { | |
// Refresh media library each time on click of add media. | |
if ( wp.media ) { | |
wp.media.view.Modal.prototype.on( 'open', function () { | |
if ( wp.media.frame.content.get() !== null ) { | |
// this forces a refresh of the content. | |
wp.media.frame.content.get().collection._requery( true ); | |
} | |
} ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'amp_extract_image_dimensions_batch', function ( $dimensions ) { | |
$home_url = get_home_url(); | |
foreach ( $dimensions as $url => &$data ) { | |
if ( false !== strpos( $url, $home_url ) ) { | |
$attachment_id = wpcom_vip_attachment_url_to_postid( $url ); | |
if ( false !== $attachment_id ) { | |
$src = wp_get_attachment_image_src( $attachment_id ); | |
$height = $src[1]; | |
$width = $src[2]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.from(document.getElementsByClassName('attachment_download')).forEach(function(elem) { | |
setTimeout(() => { | |
elem.click(); | |
}, key * 2000 ) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage ./temperature_cron.sh $HOME/pi-temp-log | |
timestamp=`date +%F` | |
temp=`/opt/vc/bin/vcgencmd measure_temp` | |
temp=${temp:5:16} | |
mkdir -p $1 # make sure dir exists | |
echo "$(date +%H:%M:%S) = $temp" >> $1/temperature_log_$timestamp.txt # create new file for each day. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Utkarsh\acf; | |
/** | |
* Exclude current post from ACF filter. | |
* Add param include_current_post => true in ACF field if you need include current post. Defaults to exclude. | |
* | |
* @param array $args WP_Query args. | |
* @param array $field ACF field params. | |
* @param int $post_id current post id. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Host dockerServer | |
Hostname server-host-or-ip | |
User ssh-remote-user | |
LocalForward 8088 localhost:8088 | |
LocalForward 3306 localhost:3306 | |
ServerAliveInterval 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.site__navigation .tab-bar .mdc-tab .material-icons { | |
color: var(--mdc-theme-on-header, var(--mdc-theme-on-primary, #fff)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace utkarsh; | |
add_action( 'wp_enqueue_media', __NAMESPACE__ . '\\media_filter' ); | |
/** | |
* Add media filter script. | |
*/ |