Skip to content

Instantly share code, notes, and snippets.

View aslamdoctor's full-sized avatar
💭
Always working but happy to talk 👍

Aslam Doctor aslamdoctor

💭
Always working but happy to talk 👍
View GitHub Profile
@ixahmedxi
ixahmedxi / settings.json
Created January 2, 2024 20:45
VSCode settings.json
{
// open json editor for settings
"workbench.settings.editor": "json",
// Theme
"workbench.colorTheme": "Aura Dark",
"workbench.iconTheme": "moxer-icons",
// Change font
"editor.fontFamily": "Geist Mono",
@lgladdy
lgladdy / custom-acf-json-paths.php
Last active January 11, 2024 16:09
ACF 6.2 custom load and save paths for ACF JSON
<?php
add_filter( 'acf/json/load_paths', 'set_custom_json_load_paths' );
function set_custom_json_load_paths( $paths ) {
$paths[] = get_stylesheet_directory() . '/acf-json/post-types';
$paths[] = get_stylesheet_directory() . '/acf-json/field-groups';
$paths[] = get_stylesheet_directory() . '/acf-json/taxonomies';
$paths[] = get_stylesheet_directory() . '/acf-json/option-pages';
return $paths;
}
@yanknudtskov
yanknudtskov / remove-spam-users.sql
Created May 23, 2020 23:41
Delete SPAM users from WordPress/WooCommerce. They usually never have a first name set
# Use with EXTREME CAUTION
DELETE FROM wp_users WHERE ID IN ( SELECT user_id FROM wp_usermeta
WHERE meta_key = 'wp_capabilities' AND meta_value LIKE '%subscriber%'
AND user_id NOT IN ( SELECT user_id FROM wp_usermeta
WHERE meta_key = 'billing_first_name' AND meta_value != ''
AND user_id IN ( SELECT user_id FROM wp_usermeta
WHERE meta_key = 'wp_capabilities' AND meta_value LIKE '%subscriber%' ) ) )
DELETE FROM wp_usermeta WHERE user_id IN ( SELECT user_id FROM wp_usermeta
@avataru
avataru / EloquentCheatSheet.md
Last active April 5, 2024 20:39
Eloquent relationships cheat sheet
@mikejolley
mikejolley / query.sql
Created April 26, 2016 09:37
WooCommerce - SQL to Delete users with no orders or posts
DELETE from wp_users where wp_users.ID not in (
SELECT meta_value FROM wp_postmeta WHERE meta_key = '_customer_user'
) AND wp_users.ID not in (
select distinct(post_author) from wp_posts
);
delete from wp_usermeta where wp_usermeta.user_id not in (select ID from wp_users);
@gokulkrishh
gokulkrishh / media-query.css
Last active April 24, 2024 17:27
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@AmirHossein
AmirHossein / coordinatestoname.js
Last active December 25, 2023 11:15
Get City and Country name by coordinates via Google Maps api
// Demo: http://jsfiddle.net/xuyp8qb5/
// Note: You need Google Map API Key to run demo; bit.ly/2pBgToW
var latlng;
latlng = new google.maps.LatLng(40.730885, -73.997383); // New York, US
//latlng = new google.maps.LatLng(37.990849233935194, 23.738339349999933); // Athens, GR
//latlng = new google.maps.LatLng(48.8567, 2.3508); // Paris, FR
//latlng = new google.maps.LatLng(47.98247572667902, -102.49018710000001); // New Town, US
//latlng = new google.maps.LatLng(35.44448406385493, 50.99001635390618); // Parand, Tehran, IR
//latlng = new google.maps.LatLng(34.66431108560504, 50.89113940078118); // Saveh, Markazi, IR
@Vestride
Vestride / encoding-video.md
Last active April 24, 2024 09:59
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@jojobyte
jojobyte / ContextCmder-Disable.reg
Last active October 5, 2023 13:13
Cmder Context (Right-Click) Menu for Windows 7, 8, 10 & 11
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
[-HKEY_CLASSES_ROOT\Directory\shell\Cmder]