Skip to content

Instantly share code, notes, and snippets.

View AminulBD's full-sized avatar

Aminul Islam AminulBD

View GitHub Profile
@AminulBD
AminulBD / fun.php
Created February 23, 2017 05:28
Add search form to the menu item
add_filter( 'wp_nav_menu_items','dt_corpo_search_box_to_menu', 10, 2 );
function dt_corpo_search_box_to_menu( $items, $args ) {
if( $args->theme_location == 'main' )
$items .= '<li id="menu-search-form">' . get_search_form( false ) . '</li>';
return $items;
}
@AminulBD
AminulBD / form.js
Created February 1, 2017 04:34
Ajax Contact form with example php functions
$('[data-deventform]').each(function () {
var $this = $(this);
$('.form-result', $this).css('display', 'none');
$this.submit(function () {
$('button[type="submit"]', $this).addClass('clicked');
$.ajax({
url: $this.attr('action'),
@AminulBD
AminulBD / app.css
Created September 11, 2016 05:31
Multi dropdown menu
ul {
padding: 0;
margin: 0;
}
ul > li {
list-style: none;
background-color: #DDD;
margin-bottom: 10px;
position: relative;
Windows Registry Editor Version 5.00
; Don't always show Command Prompt Here
; howtogeek.com
[HKEY_CLASSES_ROOT\Directory\shell\cmd]
"Extended"=""
[HKEY_CLASSES_ROOT\Directory\Background\shell\cmd]
"Extended"=""
@AminulBD
AminulBD / sendy.php
Created July 3, 2016 09:41 — forked from Pross/sendy.php
Add to mu-plugins folder, auto add every new user to a sendy list. Works with default WordPress and Woocommerce registrations.
<?php
add_action( 'user_register', 'add_user_to_sendy_list' );
function add_user_to_sendy_list( $user_id ) {
$list = 'SENDY_LIST_ID';
$url = 'http://SENDY_INSTALL_URL/subscribe';
$user = get_userdata( $user_id );
$email = $user->data->user_email;
$name = $user->data->user_nicename;
@AminulBD
AminulBD / open-with-sublime.bat
Last active August 7, 2016 05:04 — forked from roundand/OpenWithSublimeText3.bat
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 10)
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem clean up sublime default shell
reg delete "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text" /f
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Sublime Text" /t REG_SZ /v "" /d "Open with Sublime Text" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Sublime Text" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@AminulBD
AminulBD / gist:c0a3f4f165a2aaf662d3a228f6dd9107
Created May 27, 2016 07:29 — forked from fernandoaleman/gist:5083680
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
@AminulBD
AminulBD / wp-increase-timeout.php
Created May 21, 2016 13:01 — forked from sudar/wp-increase-timeout.php
Increase the curl timeout in WordPress
<?php
Copied from http://fatlabmusic.com/blog/2009/08/12/how-to-fix-wp-http-error-name-lookup-timed-out/
//adjustments to wp-includes/http.php timeout values to workaround slow server responses
add_filter('http_request_args', 'bal_http_request_args', 100, 1);
function bal_http_request_args($r) //called on line 237
{
$r['timeout'] = 15;
return $r;
}
@AminulBD
AminulBD / mac-osx-el-captain-commands.sh
Last active May 19, 2016 04:35 — forked from rahul286/mac-osx-el-captain-commands.sh
Updating to Mac elCapitan using downloaded pkg file
## based on https://github.com/lioonline/OS-X-El-Capitan
## pkg file link - http://osxapps.itunes.apple.com/apple-assets-us-std-000001/Purple3/v4/74/d2/82/74d28291-9db9-7ae2-305d-9b8b3f5fd463/ftk3252456602304584541.pkg
# Run this from folder where you have downloaded or copied ftk3252456602304584541.pkg file
#create a tmp folder
mkdir elCapitanRoot && cd elCapitanRoot
#create a folder structure to match apple server
sudo mkdir -p ./apple-assets-us-std-000001/Purple3/v4/74/d2/82/74d28291-9db9-7ae2-305d-9b8b3f5fd463/
@AminulBD
AminulBD / dt-blog-action.php
Created January 13, 2016 13:39
DecentThemes Action Shortcode For Blog Posts
function dt_blog_action_styles() { ?>
<style>
.dt-blog-action {
text-align: center;
padding: 25px;
}
.dt-blog-action > a {
position: relative;
overflow: hidden;