Skip to content

Instantly share code, notes, and snippets.

View tanzilhuda's full-sized avatar

Tanzil Huda tanzilhuda

View GitHub Profile
@tanzilhuda
tanzilhuda / Custom post query: wordpress
Last active August 22, 2017 07:09
custom-post-query
<?php
// The Query
$the_query = new WP_Query( array(
'post_type'=>array('post')
));
// The Loop
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
$the_query->the_post();
echo get_the_title();
@tanzilhuda
tanzilhuda / All-Bootstrap-Code.txt
Last active November 25, 2016 14:16
All BootStrap Code
.active
.affix
.alert
.alert-danger
.alert-dismissible
.alert-info
.alert-link
.alert-success
.alert-warning
.arrow
config.php
------------
<?php
define("DB_HOST", "localhost");
define("DB_USER", "root");
define("DB_PASS", "");
define("DB_NAME", "your_db_name");
?>
@tanzilhuda
tanzilhuda / https and remove index.php
Last active December 9, 2017 08:21
remove index.php and https setup
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index\.php($|\ |\?)
RewriteRule ^ /%1 [R=301,L]
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
@tanzilhuda
tanzilhuda / Delete Button Warning
Last active May 6, 2018 19:06
Delete Button Warning
onclick="return confirm('are you sure to delete!')"
For Bootbox js
==============
CND:
https://cdnjs.cloudflare.com/ajax/libs/bootbox.js/4.4.0/bootbox.min.js
html:
id="delete"
Example:
<a id="delete" href="#"><button class="btn btn-outline-danger">Delete</button></a>
use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
}
@tanzilhuda
tanzilhuda / gist:eb36f780d53e1f74451e384e26c022e2
Last active August 3, 2020 15:18
Combine Multiple Excel Spreadsheet into One Excel File
Sub GetSheets()
'Update ExcelJunction.com
Path = ""
Filename = Dir(Path & "*.xls")
Do While Filename <> ""
Workbooks.Open Filename:=Path & Filename, ReadOnly:=True
For Each Sheet In ActiveWorkbook.Sheets
Sheet.Copy After:=ThisWorkbook.Sheets(1)
Next Sheet
Workbooks(Filename).Close
==========================
--------Ascending---------
==========================
Sub SortSheets1()
Dim I As Integer
Dim J As Integer
For I = 1 To Sheets.Count - 1
For J = I + 1 To Sheets.Count
If UCase(Sheets(I).Name) > UCase(Sheets(J).Name) Then
@tanzilhuda
tanzilhuda / gist:26143983d103bfc32b0d47cdda0e6b4b
Created August 4, 2020 21:47
Delete same rows across multiple sheets In Excel
Sub bleh()
Dim xWs As Worksheet
Set xWs = ActiveSheet
ThisWorkbook.Worksheets.Select
Rows("10:20").Select
Selection.Delete
xWs.Select
End Sub
@tanzilhuda
tanzilhuda / gist:dc81359e726ca341a17feaae18747ada
Created August 5, 2020 20:22
Rename Sheet basis of row or column name
Sub RenameSheet()
Dim rs As Worksheet
For Each rs In Sheets
rs.Name = rs.Range("B2")
Next rs
End Sub