This file contains 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
<html> | |
<head> | |
<title> | |
Sending attachment using PHP | |
</title> |
This file contains 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 | |
// enqueue these scripts and styles before admin_head | |
wp_enqueue_script( 'jquery-ui-dialog' ); // jquery and jquery-ui should be dependencies, didn't check though... | |
wp_enqueue_style( 'wp-jquery-ui-dialog' ); | |
?> | |
<!-- The modal / dialog box, hidden somewhere near the footer --> | |
<div id="my-dialog" class="hidden" style="max-width:800px"> | |
<h3>Dialog content</h3> | |
<p>This is some terribly exciting content inside this dialog. Don't you agree?</p> |
This file contains 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
// 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 |
This file contains 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 | |
/* | |
* Google Font Importer | |
*/ | |
$fonts = "https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyCpfnm5kVng8hhP_jnAnnTXVP7MEUM89-k"; | |
$fonts = file_get_contents($fonts, 0, null, null); | |
$fp = fopen('fonts.txt', 'w'); |
This file contains 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
DROP TABLE currency; | |
-- Create table variable | |
CREATE TABLE currency ( | |
country VARCHAR(100), | |
currency VARCHAR(100), | |
code VARCHAR(100), | |
symbol VARCHAR(100) | |
); |
This file contains 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
INSERT INTO `country` (`id`,`country_name`,`code`,`currency_name`, `currency_symbol`, `currency_code`) VALUES | |
(1, 'Afghanistan', 'AF', '+93', 'Afghan afghani', 'Af', 'AFN'), | |
(2, 'ÅLAND ISLANDS', 'AX', '+358', 'Euro', '€', 'EUR'), | |
(3, 'Albania', 'AL', '+355', 'Albanian lek', 'Lek', 'ALL'), | |
(4, 'Algeria', 'DZ', '+213', 'Algerian dinar', 'دج', 'DZD'), | |
(5, 'American Samoa', 'AS', '+1684', 'US Dollar', '$', 'USD'), | |
(6, 'Andorra', 'AD', '+376', 'Euro', '€', 'EUR'), | |
(7, 'Angola', 'AO', '+244', 'Angolan kwanza', 'Kz', 'AOA'), | |
(8, 'Anguilla', 'AI', '+1264', 'East Caribbean dolla', '$', 'XCD'), | |
(9, 'Antarctica', 'AQ', '+672', 'No universal currency', '', ''), |
This file contains 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 | |
/** | |
* A simple regex to test whether or not a facebook url is valid. For basic usage, this will do the job. | |
* @see Test cases <http://ideone.com/ZMJp4f> | |
*/ | |
$fbUrlCheck = '/^(https?:\/\/)?(www\.)?facebook.com\/[a-zA-Z0-9(\.\?)?]/'; | |
$secondCheck = '/home((\/)?\.[a-zA-Z0-9])?/'; | |
$validUrl = 'https://www.facebook.com/atomicpages/'; | |
This file contains 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 React, { useState } from "react"; | |
import ReactDOM from "react-dom"; | |
const style = { | |
table: { | |
borderCollapse: "collapse", | |
}, | |
tableCell: { | |
border: "1px solid gray", | |
margin: 0, |
This file contains 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
const checkSudoku = board => { | |
const isSudokuArrayValid = (array) => { | |
const row = array.slice(0).sort().join(''), | |
passingRow = [1,2,3,4,5,6,7,8,9].join(''); | |
return (row === passingRow); | |
}; | |
const testRows = (board) => board.every(row => isSudokuArrayValid(row)); |
This file contains 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> | |
<head> | |
<title>My Iframe</title> | |
</head> | |
<body> | |
<button>Botão</button> | |
<script type="text/javascript"> |
OlderNewer