This file contains hidden or 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
(function(console){ | |
console.save = function(data, filename){ | |
if(!data) { | |
console.error('Console.save: No data') | |
return; | |
} | |
if(!filename) filename = 'console.json' |
This file contains hidden or 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 | |
// require 'auth.php'; | |
$username = 'username'; | |
$password = 'password'; | |
$url = 'https://us19.api.mailchimp.com'; | |
// $postvars = "[email protected]&status=subscribed"; | |
$postvars = [ | |
"email_address"=> "[email protected]", | |
"status"=> "subscribed", | |
"merge_fields" => [ |
This file contains hidden or 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
/** | |
* This function will return array start and end index | |
* which can be use in array slice Method | |
* @param {int} pageNumber | |
* @param {int} posts_per_page | |
* Logic Behind it | |
* 5 | |
0 0 5 | |
1 5 10 | |
2 10 15 |
This file contains hidden or 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
// following function will be use when you apply this shortcode: [render-posts type="post"] | |
function post_template($id){ | |
$c_id = $id; | |
$post_img_url = get_the_post_thumbnail_url($c_id, 'large'); | |
$title = esc_html(get_the_title($c_id)); | |
$html = ''; | |
$html .= '<a href="'.get_permalink($c_id).'" class="default-post-template">'; | |
if($post_img_url): | |
$html .= '<img src="'.$post_img_url.'" alt="'.$title.'">'; | |
endif; |
This file contains hidden or 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
/** | |
* Function to check whether to remember the sorting order or not | |
* | |
* @param array $analyzed_sql_results the analyzed query and other variables set | |
* after analyzing the query | |
* | |
* @return boolean | |
*/ | |
function PMA_isRememberSortingOrder($analyzed_sql_results) | |
{ |
This file contains hidden or 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
import json | |
from .models import MyModel | |
def get_json(request): | |
# Return JSON for filtered MyModel objects | |
records = MyModel.objects.filter(myproperty=myvalue) |
This file contains hidden or 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
wait_timeout=28800 | |
interactive_timeout = 28800 | |
post_max_size = 800M | |
upload_max_filesize = 800M | |
max_execution_time = 5000 | |
max_input_time = 5000 | |
memory_limit = 1000M | |
This file contains hidden or 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 | |
$file = '/path/to/file.png'; | |
$filename = basename($file); | |
$upload_file = wp_upload_bits($filename, null, file_get_contents($file)); | |
if (!$upload_file['error']) { | |
$wp_filetype = wp_check_filetype($filename, null ); | |
$attachment = array( | |
'post_mime_type' => $wp_filetype['type'], | |
'post_parent' => $parent_post_id, |
This file contains hidden or 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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>time</title> | |
</head> | |
<style> | |
h2{ |