Skip to content

Instantly share code, notes, and snippets.

Avatar
😊
Happy

Abhishek Ghosh AbhishekGhosh

😊
Happy
View GitHub Profile
@AbhishekGhosh
AbhishekGhosh / code.php
Last active Sep 29, 2021
Ad Invalid Click Protector code
View code.php
// Install https://wordpress.org/plugins/ad-invalid-click-protector/
<?php
if( aicp_can_see_ads() ) {
// This part will show ads to your non-banned visitors
$adCode = '<div class="aicp">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- responsive_box -->
<ins class="adsbygoogle right-floating-ad"
View doorbell.ino
// connects once upon pressing ESP32 boot pushbutton (GPIO 0) button and sends a message, closes connection
// written by Dr. Abhishek Ghosh, https://thecustomizewindows.com
// released under GNU GPL 3.0
const byte BUTTON=18; // boot button pin (built-in on ESP32)
const byte LED=2; // onboard LED (built-in on ESP32)
#include <WiFi.h>
@AbhishekGhosh
AbhishekGhosh / http2_apache2_ubuntu16.04.md
Created Sep 5, 2020 — forked from GAS85/http2_apache2_ubuntu16.04.md
How to Enable HTTP/2 in Apache 2.4 on Ubuntu 16.04
View http2_apache2_ubuntu16.04.md

Requirements

  • A self-managed VPS or dedicated server with Ubuntu 16.04 running Apache 2.4.xx.
  • For Ubuntu 18.04 please read here --> https://gist.github.com/GAS85/8dadbcb3c9a7ecbcb6705530c1252831
  • A registered domain name with working HTTPS (TLS/SSL). HTTP/2 only works alongside HTTPS because most browsers, including Firefox and Chrome, don’t support HTTP/2 in cleartext (non-TLS) mode.
@AbhishekGhosh
AbhishekGhosh / genesis_before_content_sidebar_wrap.php
Created Jun 23, 2020
Genesis custom homepage content via genesis_before_content_sidebar_wrap Hook
View genesis_before_content_sidebar_wrap.php
<?php if(is_front_page() && !is_paged()) : ?>
<div id="pagewrap-tcw">
<?php
$id = 5670;
$p = get_page($id);
echo apply_filters('the_content', $p->post_content);
?>
</div>
<?php endif; ?>
@AbhishekGhosh
AbhishekGhosh / 5670.php
Created Jun 23, 2020
WordPress show post content example with page ID 5670
View 5670.php
<?php
$id = 5670;
$p = get_page($id);
echo apply_filters('the_content', $p->post_content);
?>
@AbhishekGhosh
AbhishekGhosh / post-content.php
Created Jun 23, 2020
Show WordPress Post Content
View post-content.php
<?php
$id = ID#;
$p = get_page($id);
echo apply_filters('the_content', $p->post_content);
?>
@AbhishekGhosh
AbhishekGhosh / home_with_div.php
Created Jun 23, 2020
Genesis Home Page with div
View home_with_div.php
<?php if(is_front_page() && !is_paged()) : ?>
<div id="pagewrap-tcw"></div>
</div>
<?php endif; ?>
@AbhishekGhosh
AbhishekGhosh / homepage.php
Created Jun 23, 2020
Show Only on Genesis Home Page
View homepage.php
<?php if(is_front_page() && !is_paged()) : ?>
<?php endif; ?>
@AbhishekGhosh
AbhishekGhosh / switch.ino
Created Feb 20, 2020
Samsung Smartwatch as Proximity Switch
View switch.ino
#include <BLEAdvertisedDevice.h>
#include <BLEDevice.h>
#include <BLEScan.h>
const int PIN = 2;
const int CUTOFF = -60;
void setup() {
pinMode(PIN, OUTPUT);
BLEDevice::init("");
@AbhishekGhosh
AbhishekGhosh / esp32.cc
Created Dec 2, 2019
Connect ESP32 Arduino With a Samsung Smart Watch
View esp32.cc
#include <WiFi.h>
#include <WebServer.h>
/* Put your SSID & Password */
const char* ssid = "ESP32"; // Enter SSID here
const char* password = "12345678"; //Enter Password here
/* Put IP Address details */
IPAddress local_ip(192,168,1,1);
IPAddress gateway(192,168,1,1);