Skip to content

Instantly share code, notes, and snippets.

View kavehkm's full-sized avatar
⚜️
working...

kaveh kavehkm

⚜️
working...
View GitHub Profile
@kavehkm
kavehkm / contributing.md
Last active December 31, 2025 10:26 — forked from MarcDiethelm/Contributing.md
How to contribute to a project on Github

This text now lives at https://github.com/MarcDiethelm/contributing/blob/master/README.md. I turned it into a Github repo so you can, you know, contribute to it by making pull requests.


Contributing

If you want to contribute to a project and make it better, your help is very welcome. Contributing is also a great way to learn more about social coding on Github, new technologies and and their ecosystems and how to make constructive, helpful bug reports, feature requests and the noblest of all contributions: a good, clean pull request.

@kavehkm
kavehkm / nginx-wordpress.conf
Created October 20, 2022 07:43 — forked from nfsarmento/nginx-wordpress.conf
Harden wordpress security nginx
############ WordPress ####################
# Disable logging for favicon and robots.txt
location = /favicon.ico {
try_files /favicon.ico @empty;
access_log off;
log_not_found off;
expires max;
}
@kavehkm
kavehkm / meta-tags.md
Created April 29, 2022 19:13 — forked from whitingx/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>
@kavehkm
kavehkm / loop.sql
Created March 19, 2022 09:22
sql loop through moein invoices
declare @id INT
declare @getid cursor
set @getid = cursor for select ID from factor1 where CodeFactor is NULL;
open @getid
fetch next
from @getid into @id
@kavehkm
kavehkm / wp_request.py
Last active December 31, 2025 10:26
Working with wordpress REST-API
# requests
import requests
from requests.auth import HTTPBasicAuth
YOUR_DOMAIN = ''
YOUR_USERNAME = ''
YOUR_APPLICATION_PASSWORD = ''
<?php
function km_update_products_downloads() {
if (current_user_can('administrator') {
$args = [
'limit' => -1,
'category' => ['category1-slug', 'category2-slug']
];
// get products
$products = wc_get_products($args);
// id, name and file