Skip to content

Instantly share code, notes, and snippets.

View mujahidi's full-sized avatar

Mujahid Ishtiaq mujahidi

  • Pakistan
  • 07:55 (UTC +05:00)
View GitHub Profile
@mujahidi
mujahidi / google-maps-api-marker-arrow.css
Created October 10, 2018 17:22
Change Google Maps marker arrow's position using css
.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;
@mujahidi
mujahidi / index.html
Created September 26, 2018 19:26
Sticky Sidebar
<!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;
@mujahidi
mujahidi / wp_user_query_pagination.php
Created May 29, 2018 12:49
Pagination with WP_User_Query object
<?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;
@mujahidi
mujahidi / highest-value-in-wp-post-meta.php
Created May 25, 2018 21:58
Get the highest value from WordPress post meta
<?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
@mujahidi
mujahidi / download-upload-file-folder-commands.txt
Last active March 4, 2019 20:57
Download/Upload file/folder through terminal commands
#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