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
// first select all liked buttons | |
var buttons = document.getElementsByClassName('PageLikedButton'); | |
// launch pop for liked button | |
for(let button of buttons){ | |
button.click(); | |
}; | |
// select unlike button parent to prevent timeline button clicks | |
var unlikes = document.getElementsByClassName('InterestListMenuDisconnect'); |
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 regex lets you validate credit cards and their types (including Visa, Mastercard, American Express and Discover cards) | |
^(?:4[0-9]{12}(?:[0-9]{3})? // Visa | |
| 5[1-5][0-9]{14} // Mastercard | |
| 3[47][0-9]{13} // American Express | |
| 6(?:011|5[0-9]{2})[0-9]{12} // Discover | |
)$ |
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 | |
// loading image: using PHP's GD library to load the image from its file or URL | |
$img = imagecreatefromjpeg('image.jpg'); | |
// getting image size: using getimagesize() function to get the width and height of the image | |
list($width, $height) = getimagesize($img); | |
// extracting image metadata: using exif_read_data() function to extract the image metadata, including camera settings, location, and time | |
$exif = exif_read_data($img); |
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 git demonstrates the use of decentralized applications and blockchain technology using web3.js. | |
// Here's an example of a simple smart contract that stores and returns a message. | |
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
contract MessageContract { | |
string private message; | |
function setMessage(string memory newMessage) public { |
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 | |
//client script | |
$FCM_KEY = "__YOUR_FIREBASE_AUTH_KEY__"; | |
function fcm_push($token, $title, $text, $uri, $img='', $custom_data=[]){ | |
global $FCM_KEY; | |
$url = 'https://fcm.googleapis.com/fcm/send'; | |
$headers = array('Content-Type: application/json', 'Authorization: key='.$FCM_KEY); |