Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
Writing Code.

MC Naveen mcnaveen

👨‍💻
Writing Code.
View GitHub Profile
View check_authorization.php
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
@mcnaveen
mcnaveen / Download.php
Last active Mar 15, 2021
PHP Download ZIP file and Hide Download URL
View Download.php
<?php
$path = 'file.zip'; //Path to File
$filedownloadname = 'downloadfilename.zip'; //File Name when downloading
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Type: " . $mime_type);
@mcnaveen
mcnaveen / Timezone Dropdown
Created Mar 14, 2021
List of all Timezone as a HTML Dropdown
View Timezone Dropdown
<html><body>
<select>
<option id='Africa/Abidjan'>Africa/Abidjan </option>
<option id='Africa/Accra'>Africa/Accra</option>
<option id='Africa/Addis_Ababa'>Africa/Addis_Ababa</option>
<option id='Africa/Algiers'>Africa/Algiers</option>
<option id='Africa/Asmara'>Africa/Asmara</option>
<option id='Africa/Asmera'>Africa/Asmera</option>
<option id='Africa/Bamako'>Africa/Bamako</option>
@mcnaveen
mcnaveen / Stop Heroku from Sleep [Easy Way].md
Last active Nov 14, 2020
Stop Heroku from Sleep [Easy Way]
View Stop Heroku from Sleep [Easy Way].md

Create Google Apps script with the Following Code.

https://script.google.com/

Replace YOURAPPNAME

function ping() {
  UrlFetchApp.fetch("https://YOURAPPNAME.herokuapp.com/");
}
View part1.html
<center>
<div class="fb-messenger-checkbox" origin="" page_id="PAGEID" messenger_app_id="APPID" user_ref="" prechecked="true" allow_login="true" size="large"></div >
</center>
<script> window.fbMessengerPlugins = window.fbMessengerPlugins || {
init: function() {
FB.init({
appId: "APPID",
xfbml: true,
version: "v8.0"
View netdata nginx.conf
upstream backend {
server 127.0.0.1:19999;
keepalive 64;
}
server {
access_log /var/log/nginx/netdata-access.log;
error_log /var/log/nginx/netdata-error.log;
# listen SERVERIP;
@mcnaveen
mcnaveen / Cloudflare Workers Dual Parameter
Created Nov 4, 2020
Cloudflare Workers Dual Parameter
View Cloudflare Workers Dual Parameter
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
async function fetchAndApply(request) {
const init = {
method: 'GET'
}
const { searchParams } = new URL(request.url);
let param1 = searchParams.get('param1');
let param2 = searchParams.get('param2');
@mcnaveen
mcnaveen / file.php
Created Oct 18, 2020
Add Custom Fields to WooCommerce Checkout and Store in Order Details Page
View file.php
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field');
function my_custom_checkout_field( $checkout ) {
echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>';
woocommerce_form_field( 'my_field_name', array(
'type' => 'text',
'class' => array('my-field-class orm-row-wide'),
'label' => __('Fill in this field'),
View Ubuntu 14.04 Sources List.md
#deb cdrom:[Ubuntu 14.04.3 LTS _Trusty Tahr_ - Beta amd64 (20150805)]/ trusty main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ trusty main restricted

## Major bug fix updates produced after the final release of the
## distribution.
View URL-encoding : ASCII Character.md
  • %20 : space
  • %21 : !
  • %22 : “
  • %23 : #
  • %24 : $
  • %25 : %
  • %26 : &
  • %27 : ‘
  • %28 : (
  • %29 : )