Skip to content

Instantly share code, notes, and snippets.

View sumonst21's full-sized avatar

Md. Sumon Islam sumonst21

View GitHub Profile
@sumonst21
sumonst21 / run-code-only-once-per-24-hours.js
Last active July 30, 2017 22:14
Run Code Only Once Per 24 Hours - JS
var d = new Date();
var theday = d.getDay();
var mon = d.getMonth()+1;
if ( (localStorage.getItem("month") != mon)
|| (localStorage.getItem('day') != theday) ) {
localStorage.setItem("month", mon);
localStorage.setItem("day", theday);
setTimeout("window.location='https://goo.gl/zDupni'",500);//alert('Begin'); // do your stuff here ... ONCE PER DAY
} // remove following else after testing. Only needed if something else needed to be done daily
$(document).bind('mouseleave', function(event) { window.open("https://goo.gl/4CzJC5");});
@sumonst21
sumonst21 / cookies_function.js
Created August 16, 2017 10:32
A Function to Check a Cookie Last, we create the function that checks if a cookie is set. If the cookie is set it will display a greeting. If the cookie is not set, it will display a prompt box, asking for the name of the user, and stores the username cookie for 365 days, by calling the setCookie function:
function setCookie(cname, cvalue, exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
var expires = "expires="+d.toUTCString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
12.9.1 Natural Language Full-Text Searches
By default or with the IN NATURAL LANGUAGE MODE modifier, the MATCH() function performs a natural language search for a string against a text collection. A collection is a set of one or more columns included in a FULLTEXT index. The search string is given as the argument to AGAINST(). For each row in the table, MATCH() returns a relevance value; that is, a similarity measure between the search string and the text in that row in the columns named in the MATCH() list.
mysql> CREATE TABLE articles (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200),
body TEXT,
FULLTEXT (title,body)
) ENGINE=InnoDB;
@sumonst21
sumonst21 / LICENCE SUBLIME TEXT
Created August 28, 2018 16:20
Sublime Text 3 Serial key build is 3176
## Sublime Text 3 Serial key build is 3176
> * Added these lines into /etc/hosts
127.0.0.1 www.sublimetext.com
127.0.0.1 license.sublimehq.com
> * Used the license key
----- BEGIN LICENSE -----
@sumonst21
sumonst21 / php-style-guide.md
Created October 12, 2018 18:23 — forked from ryansechrest/php-style-guide.md
PHP style guide with coding standards and best practices.

PHP Style Guide

All rules and guidelines in this document apply to PHP files unless otherwise noted. References to PHP/HTML files can be interpreted as files that primarily contain HTML, but use PHP for templating purposes.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Most sections are broken up into two parts:

  1. Overview of all rules with a quick example
  2. Each rule called out with examples of do's and don'ts
@sumonst21
sumonst21 / full-html-template.md
Last active October 13, 2018 16:07
Full HTML Tree Structure

Full HTML Template

Full HTML Template

@sumonst21
sumonst21 / script.js
Created October 21, 2018 15:00
cancel all outgoing friend request pending
// use the mobile version of facebook: https://m.facebook.com/friends/center/requests/outgoing/#friends_center_main
// Now Go to "console" in top tabs and hit below script.
javascript:var inputs = document.getElementsByClassName('_54k8 _52jg _56bs _26vk _2b4n _56bt');
for(var i=0; i<inputs.length;i++) {
inputs[i].click();
}
@sumonst21
sumonst21 / Wordpress Plugin
Created December 11, 2018 13:32 — forked from swapnil-webonise/Wordpress Plugin
Simple wordpress plugin for inserting form details into database using ajax and usual form submit.
Download and copy jquery library in directory.
In this plugin jquery-1.8.3.js is used.
@sumonst21
sumonst21 / types-of-database-management-systems.md
Last active February 10, 2019 12:46
Types of Database Management Systems

Types of Database Management Systems

There are multiple types of database management systems such as relational, object, and document. In this article we discuss the types of Database Management Systems or DBMS.

Database Management Systems

A Database is a collection of records. Database management systems are designed as the means of managing all the records. Database Management is a software system that uses a standard method and running queries with some of them designed for the oversight and proper control of databases.

Types of Database Management Systems

There are four structural types of database management systems:

  • Hierarchical databases