Skip to content

Instantly share code, notes, and snippets.

View aliqorbani's full-sized avatar
🏠
Working from home

Ali Qorbani aliqorbani

🏠
Working from home
View GitHub Profile
@aliqorbani
aliqorbani / reloading-iframe.html
Last active June 1, 2024 10:24
reload a custom url using iframe and js with loop
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Reloading iframe using js</title>
</head>
<body>
<iframe marginwidth="0" id="inserts" marginheight="0" scrolling="no" src="" frameborder="0" style="height: 2em;padding: 0;margin: 0;width: 100%;"></iframe>
@aliqorbani
aliqorbani / wp-query-ref.php
Created August 27, 2021 20:18 — forked from luetkemj/wp-query-ref.php
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@aliqorbani
aliqorbani / api_json_return.php
Created April 27, 2019 10:35
here i customized a function to return json data correctly (some servers like stackexchange do not allow users to get data from out of browser for security reasons).
function api_json_return($final_url){
//I used this function to work on `https://api.stackexchange.com`
// for example this url returns my stackoverflow data = 'https://api.stackexchange.com/2.2/users/4729243?order=desc&sort=reputation&site=stackoverflow'
$ch = curl_init($final_url);
if (! defined("CURL_HTTP_VERSION_2_0")) {
define("CURL_HTTP_VERSION_2_0", 3);
}
curl_setopt_array($ch,
[
CURLOPT_RETURNTRANSFER => true,