Skip to content

Instantly share code, notes, and snippets.

View AbhishekGhosh's full-sized avatar
😊
Happy

Abhishek Ghosh AbhishekGhosh

😊
Happy
View GitHub Profile
@AbhishekGhosh
AbhishekGhosh / http2_apache2_ubuntu16.04.md
Created September 5, 2020 19:18 — forked from GAS85/http2_apache2_ubuntu16.04.md
How to Enable HTTP/2 in Apache 2.4 on Ubuntu 16.04

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 June 23, 2020 18:03
Genesis custom homepage content via genesis_before_content_sidebar_wrap Hook
<?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 June 23, 2020 17:59
WordPress show post content example with page ID 5670
<?php
$id = 5670;
$p = get_page($id);
echo apply_filters('the_content', $p->post_content);
?>
@AbhishekGhosh
AbhishekGhosh / post-content.php
Created June 23, 2020 17:57
Show WordPress Post Content
<?php
$id = ID#;
$p = get_page($id);
echo apply_filters('the_content', $p->post_content);
?>
@AbhishekGhosh
AbhishekGhosh / home_with_div.php
Created June 23, 2020 17:46
Genesis Home Page with div
<?php if(is_front_page() && !is_paged()) : ?>
<div id="pagewrap-tcw"></div>
</div>
<?php endif; ?>
@AbhishekGhosh
AbhishekGhosh / homepage.php
Created June 23, 2020 17:44
Show Only on Genesis Home Page
<?php if(is_front_page() && !is_paged()) : ?>
<?php endif; ?>
@AbhishekGhosh
AbhishekGhosh / switch.ino
Created February 20, 2020 09:58
Samsung Smartwatch as Proximity Switch
#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 December 2, 2019 16:23
Connect ESP32 Arduino With a Samsung Smart Watch
#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);
@AbhishekGhosh
AbhishekGhosh / ads.txt
Last active November 3, 2019 09:27
Sample ads.txt of thecustomizewindows.com
#Ads.txt thecustomizewindows.com
# edit the entries such google pub id, remove the duplicates
# own ads
google.com, pub-8996933744651682, DIRECT, f08c47fec0942fa0
google.com, pub-8996933744651682, RESELLER, f08c47fec0942fa0
developermedia.com, lqm.thecustomizewindows.site, DIRECT
developermedia.com, lqm.thecustomizewindows.site, RESELLER
@AbhishekGhosh
AbhishekGhosh / simpleDevice.py
Created October 13, 2019 11:28
simpleDevice.py
# *****************************************************************************
# Copyright (c) 2017, 2019 IBM Corporation and other Contributors.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
# *****************************************************************************
import time