Skip to content

Instantly share code, notes, and snippets.

View AminulBD's full-sized avatar

Aminul Islam AminulBD

View GitHub Profile
@AminulBD
AminulBD / ccdl.command
Created June 17, 2020 10:30 — forked from ayyybe/ccdl.command
Adobe Offline Package Generator v0.1.2 (macOS only)
#!/bin/bash
CYAN="$(tput bold; tput setaf 6)"
RESET="$(tput sgr0)"
clear
if command -v python3 > /dev/null 2>&1; then
if [ $(python3 -c "print('ye')") = "ye" ]; then
clear
@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/
# Based on https://gist.github.com/fernandoaleman/5083680
# Start the old vagrant
$ vagrant init ubuntu_saucy
$ 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
@AminulBD
AminulBD / enq-js.php
Last active August 29, 2015 14:22 — forked from hasinhayder/enq-js.php
#!/usr/bin/env php
<?php
foreach(glob("*.js") as $js){
echo "wp_enqueue_script( 'wptheme-{$js}', get_template_directory_uri().'/js/{$js}', array('jquery'),'1.0',true);\n";
}
#!/usr/bin/env php
<?php
foreach(glob("*.css") as $css){
echo "wp_enqueue_style( 'wptheme-{$css}', get_template_directory_uri().'/css/{$css}',null,'1.0');\n";
}
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory