This file contains 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
#Download File | |
scp user@host:/path/to/remote-file-to-download local-copy-of-file | |
#Download Folder | |
scp -r user@host:/path/to/remote-folder-to-download local-copy-of-folder | |
#Upload File | |
scp local-file user@host:/path/to/destination-where-local-file-is-uploaded | |
#Upload Folder |
This file contains 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 | |
// WordPress saves post meta values as 'longtext' type | |
// and hence, it makes it impossible to fetch the highest value based on a number. | |
// So I came up with the following solution to get the highest value from the post meta | |
// CHANGE [YOUR_META_KEY] with yours post meta key | |
global $wpdb; | |
$highest_val = $wpdb->get_var( "SELECT | |
meta_value | |
FROM |
This file contains 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 | |
// number of users we want to show per page | |
$number = 10; | |
// to pinpoint the current pagination number | |
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; | |
// count the number of users that should be passed over in the pages (offset) – this will take effect at the second page onwards. | |
$offset = ($paged - 1) * $number; |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<script src="https://code.jquery.com/jquery-3.1.0.js"></script> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
.head, .foot{ | |
background: #ccc; |
This file contains 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
.gm-style div div:nth-child(3) div div div div:nth-child(1) div:nth-child(1){ position: static !important; } | |
.gm-style div div:nth-child(3) div div div div:nth-child(1) div:nth-child(3){ display: none !important; } | |
.gm-style .gm-style-iw{ overflow: visible; } | |
.gm-style .gm-style-iw::before { | |
content: "\f141"; | |
position: absolute; | |
top: -7px; | |
left: -47px; | |
font-family: 'dashicons'; | |
font-size: 50px; |
This file contains 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
FIX BITNAMI WEIRD CACHE ISSUE: | |
1)Comment out these lines in /opt/bitnami/apache2/conf/httpd.conf using # in front of these 2: | |
Include conf/pagespeed.conf | |
Include conf/pagespeed_libraries.conf | |
2) PHP has Op Cache enabled by these lines in sudo nano /opt/bitnami/php/etc/php.ini | |
opcache.enable=1 |
This file contains 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
.myImg { | |
object-fit: cover; /* also works for videos. Can also use contain*/ | |
width: 320px; | |
height: 180px; | |
} | |
/* The Netflix Way */ | |
/* | |
this one works everywhere and it is my favorite! You’ll need to wrap your image with a relative padded parent. |
This file contains 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 | |
function remove_class_hook( $tag, $class_name = '', $method_name = '', $priority = 10 ) { | |
global $wp_filter; | |
$is_hook_removed = false; | |
if ( ! empty( $wp_filter[ $tag ]->callbacks[ $priority ] ) ) { | |
$methods = wp_list_pluck( $wp_filter[ $tag ]->callbacks[ $priority ], 'function' ); | |
$found_hooks = ! empty( $methods ) ? wp_list_filter( $methods, array( 1 => $method_name ) ) : array(); | |
foreach( $found_hooks as $hook_key => $hook ) { | |
if ( ! empty( $hook[0] ) && is_object( $hook[0] ) && get_class( $hook[0] ) === $class_name ) { |
This file contains 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 | |
$search_value = 'xyz'; // whatever | |
$field_value = sprintf( '^%1$s$|s:%2$u:"%1$s";', $search_value, strlen( $search_value ) ); | |
$args = array( | |
'post_type' => 'post', | |
'meta_query' => array( | |
array( | |
'key' => 'user_field', | |
'value' => $field_value, |
This file contains 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
<div class="video-container"> | |
<div class="another-container"> | |
<iframe src="https://player.vimeo.com/video/VIMEO-ID?background=1" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> | |
</div> | |
</div> | |
<style> | |
.video-container{ height: 550px; overflow: hidden; } | |
.another-container{ height:0; overflow:hidden; position: relative; padding-bottom: 56.25%; /* 16:9 */ } | |
#mobile_video_container iframe{ |
OlderNewer