Skip to content

Instantly share code, notes, and snippets.

View AminulBD's full-sized avatar

Aminul Islam AminulBD

View GitHub Profile
// SmoothScroll for websites v1.2.1
// Licensed under the terms of the MIT license.
// People involved
// - Balazs Galambosi (maintainer)
// - Michael Herf (Pulse Algorithm)
(function(){
// Scroll Variables (tweakable)
@AminulBD
AminulBD / mikrotik-command-local-bandwidth
Last active August 29, 2015 14:14
MikroTik RouterOS Local Bandwidth Control
10.20.0.0/16 are my pppoe client ip pool.
192.168.250.0/24 is FTP server pool. Behind Mikrotik DMZ.
/ip firewall mangle add chain=prerouting src-address=10.20.0.0/16 dst-address=192.168.250.0/24 action=mark-packet new-packet-mark=local-up
/ip firewall mangle add chain=postrouting src-address=192.168.250.0/24 dst-address=10.20.0.0/16 action=mark-packet new-packet-mark=local-down
/queue type add name=local-speed kind=sfq
/queue tree add name=local-up parent=global packet-mark=local-up queue=local-speed max-limit=100M
/queue tree add name=local-down parent=global packet-mark=local-down queue=local-speed max-limit=100M
#!/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
#!/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";
}
@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";
}
# 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 / breadcrumb.php
Created August 9, 2015 05:35
Breadcrumb for any wordpress theme.
/**
* Bredcrumbs
*
* @since 1.0.0
*/
function mytheme_the_breadcrumb () {
// Settings
$separator = '';
@AminulBD
AminulBD / mailchimp-subscribe-wp-ajax.php
Created September 11, 2015 12:27
Mailchimp Subscribe for wordpress ajax.
/**
* Mailchimp Email Subscription Handler
*
* @since 1.0.0
* @version 1.0.0
* @author Aminul Islam <aminmedia@gmail.com>
*/
function yourtheme_mailchimp_subscribe() {
// MC API and List ID
@AminulBD
AminulBD / dt-blog-action.php
Created January 13, 2016 13:38
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;
@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;