Instantly share code, notes, and snippets.

Abhishek Ghosh AbhishekGhosh

View GitHub Profile
@AbhishekGhosh
AbhishekGhosh / snippet.php
Created Aug 22, 2018
Fat Free Social Share WordPress
View snippet.php
<div class="dev-share-buttons">
<a class="button full facebook" href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>&t=<?php the_title(); ?>" target="_blank" rel="nofollow"> Facebook</a>
<a class="button full twitter" href="https://twitter.com/share?text=<?php the_title(); ?>&url=<?php the_permalink(); ?>&via=AbhishekCTRL" target="_blank" rel="nofollow"> Twitter</a>
<a class="button full google" href="https://plus.google.com/share?url=<?php the_permalink(); ?>" onclick="javascript:window.open(this.href,
'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" target="_blank" rel="nofollow"> Google+</a>
<a class="button full pinterest" href="https://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>&media=<?php
$args = array(
'numberposts' => 1,
'order'=> 'DESC',
'post_mime_type' => 'image',
@AbhishekGhosh
AbhishekGhosh / UPDATE.sql
Created Jun 19, 2018
WordPress role restore
View UPDATE.sql
UPDATE `wp_options` SET option_value='a:1:{s:13:"administrator";a:2:{s:4:"name";s:13:"Administrator";s:12:"capabilities";a:54:{s:13:"switch_themes";b:1;s:11:"edit_themes";b:1;s:16:"activate_plugins";b:1;s:12:"edit_plugins";b:1;s:10:"edit_users";b:1;s:10:"edit_files";b:1;s:14:"manage_options";b:1;s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:6:"import";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:8:"level_10";b:1;s:7:"level_9";b:1;s:7:"level_8";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:2
@AbhishekGhosh
AbhishekGhosh / stripped.ipynb
Last active Jun 1, 2018
Example stripped off notebook
View stripped.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Table.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AbhishekGhosh
AbhishekGhosh / The-Indian-Penal-Code
Created May 24, 2018 — forked from allomics/The-Indian-Penal-Code
Central Government Act - The Indian Penal Code
View The-Indian-Penal-Code
Central Government Act - The Indian Penal Code
==============================================
1. Title and extent of operation of the Code.—This Act shall be called the Indian Penal Code, and shall 1 [extend to the whole of India 2 [except the State of Jammu and Kashmir].]
2. Punishment of offences committed within India.—Every person shall be liable to punishment under this Code and not otherwise for every act or omission contrary to the provisions thereof, of which he shall be guilty within 3 [India] 4 [***].
3. Punishment of offences committed beyond, but which by law may be tried within, India.—Any person liable, by any 5 [Indian law] to be tried for an offence committed beyond [India] shall be dealt with according to the provisions of this Code for any act committed beyond [India] in the same manner as if such act had been committed within 6 [India].
7 [ 4 Extension of Code to extra-territorial offences. —The provi­sions of this Code apply also to any offence committed by—
8 [(1) any citizen of India in
@AbhishekGhosh
AbhishekGhosh / debian-sys-maint.sh
Created May 23, 2018
Percona debian-sys-maint
View debian-sys-maint.sh
#!/bin/sh
MYSQLADMIN_CFG="/etc/mysql/percona-server.conf.d/90-mysqladmin.cnf"
PASS=$(perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..16)');
sed -i "s/^password =.*$/password = ${PASS}/" /etc/mysql/debian.cnf
sed -i "s/^user =.*$/user = debian-sys-maint/" /etc/mysql/debian.cnf
umask 066
cat > ${MYSQLADMIN_CFG} <<EOF
[mysqladmin]
host = localhost
user = debian-sys-maint
@AbhishekGhosh
AbhishekGhosh / sshfpgen
Created Apr 28, 2018
Personal sshfpgen
View sshfpgen
#!/bin/bash
#
# sshfpgen - Creates SSHFP Records for all available keys
#
HOST="${1-$(hostname -f)}"
if [[ "$1" == "-h" || "$1" == "--help" ]]
then
echo "Usage: sshfpgen <hostname>"
View lcd-temp-humidity.ino
#include <LiquidCrystal.h>
#include <Adafruit_Sensor.h>
#include <DHT.h>
#include <DHT_U.h>
#define DHTPIN A0 // Pin which is connected to the DHT sensor.
// type the model of sensor in use, we are using DHT 11, if you are using DHT 21 or DHT 22 change it
#define DHTTYPE DHT11
DHT_Unified dht(DHTPIN, DHTTYPE);
LiquidCrystal lcd(7, 8, 9, 10, 11 , 12);
View ob_flush.php
<?php
/*
== ob_end_flush() ==
Flush (send) the output buffer and turn off output buffering
== ob_end_clean() ==
Clean (erase) the output buffer and turn off output buffering
== ob_get_contents() ==
@AbhishekGhosh
AbhishekGhosh / index.html
Last active Aug 22, 2017
brackets my default template
View index.html
<!DOCTYPE html>
<html>
<head>
<title>EDITED BRACKETS</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<!-- Add HTML stuffs below this -->