Skip to content

Instantly share code, notes, and snippets.

View frogsuite's full-sized avatar

Frogsuite IRD frogsuite

View GitHub Profile
@bohwaz
bohwaz / dns_get_record_from.php
Last active September 3, 2025 17:34
PHP script to retrieve a DNS record from a custom nameserver
<?php
/**
* Make a DNS a request to a custom nameserver, this is similar to dns_get_record, but allows you to query any nameserver
* Usage: dns_get_record_from('ns.server.tld', 'A', 'mydomain.tld');
* => ['42.42.42.42']
* @author bohwaz
*/
function dns_get_record_from(string $server, string $type, string $record, string $protocol = 'udp'): array
{
<!DOCTYPE html>
<html>
<body>
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-bundle@3.0.3001/dist/dcv.bundle.min.js"></script>
<input id="input-file" type="file" multiple accept=".jpg,.jpeg,.icon,.gif,.svg,.webp,.png,.bmp" /><br />
Results:<br />
<div id="results"></div>
<div id="parsedrResults" style="width: 100%; min-height: 10vh; font-size: 3vh; overflow: auto"></div>
@jsanta
jsanta / index.html
Last active February 12, 2025 13:32
PWA index.html file for Android and iOS copy & paste enabled
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Ionic App</title>
<base href="/" />
<meta
name="viewport"
@allysonsilva
allysonsilva / Full-Markdown.md
Last active October 13, 2025 12:43
⚡️ Full Markdown Example

Headers

# h1 Heading 8-)
## h2 Heading
### h3 Heading
#### h4 Heading
##### h5 Heading
###### h6 Heading
@JackNoordhuis
JackNoordhuis / extract.php
Created February 26, 2018 03:17
PHP script to convert a phar archive to a zip
<?php
$opts = getopt("", ["file:"]);
if(!isset($opts["file"])) {
echo "Please specify a path with --path" . PHP_EOL;
exit(0);
}
$filename = rtrim($opts["file"], ".phar");
@OkoyaUsman
OkoyaUsman / seconds-to-time.php
Created February 3, 2018 11:42
PHP Function to Convert Seconds into Years, Months, Days, Hours, Minutes and Seconds.
<?php
function convertSecToTime($sec){
$date1 = new DateTime("@0"); //starting seconds
$date2 = new DateTime("@$sec"); // ending seconds
$interval = date_diff($date1, $date2); //the time difference
return $interval->format('%y Years, %m months, %d days, %h hours, %i minutes and %s seconds'); // convert into Years, Months, Days, Hours, Minutes and Seconds
}
echo convertSecToTime(246395678);
//OUTPUT: 7 Years, 9 months, 21 days, 19 hours, 14 minutes and 38 seconds
?>
@newubuntu
newubuntu / centos7-php7-mssql-driver.md
Created November 5, 2017 05:35 — forked from faizalmansor/centos7-php7-mssql-driver.md
How to Install PHP 7.0 MSSQL Driver on CentOS 7
@wheelcomplex
wheelcomplex / embedded-file-viewer.md
Created October 26, 2017 05:42 — forked from tzmartin/embedded-file-viewer.md
Embedded File Viewer: Google Drive, OneDrive

Office Web Apps Viewer

('.ppt' '.pptx' '.doc', '.docx', '.xls', '.xlsx')

http://view.officeapps.live.com/op/view.aspx?src=[OFFICE_FILE_URL]

<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[OFFICE_FILE_URL]' width='px' height='px' frameborder='0'>
</iframe>

OneDrive Embed Links

@thomasdarimont
thomasdarimont / AesCipher.php
Last active November 29, 2024 09:32
Example for 128bit AES with Java and PHP
<?php
class AesCipher {
private const OPENSSL_CIPHER_NAME = "aes-128-cbc";
private const CIPHER_KEY_LEN = 16; //128 bits
private static function fixKey($key) {
if (strlen($key) < AesCipher::CIPHER_KEY_LEN) {
@amochohan
amochohan / array_merge_sum.php
Created June 5, 2015 15:50
PHP merge two arrays and sum the total of a common indexes
<?php
$balanceA=array(
"USD" => 10000,
"GBP" => 20000
);
$balanceB=array(
"USD" => 10000,
"GBP" => 20000,
"JPY" => 100