Skip to content

Instantly share code, notes, and snippets.

View tojibon's full-sized avatar
:octocat:
Finalizing

Juyal Ahmed tojibon

:octocat:
Finalizing
View GitHub Profile
@tojibon
tojibon / functions.php
Last active August 29, 2015 14:18
WordPress JS enqueue
add_action( 'wp_enqueue_scripts', 'mondira_slider_options' );
function mondira_slider_options(){
wp_enqueue_script( 'theme-slider', get_template_directory_uri() . '/js/theme-slider.js', array( 'jquery' ) );
wp_enqueue_script( 'theme-slider-init', get_template_directory_uri() . '/js/init.js', array( 'jquery', 'theme-slider' ) );
// get user options
$options = array();
$options['autoplay'] = get_theme_mod( 'slider-autoplay', true );
$options['navigation_style'] = get_theme_mod( 'numbers', 'circles' );
@tojibon
tojibon / index.html
Created May 5, 2015 12:32
CSS Image Zoom and Overlay Color Animation
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<title>CSS Background Color Animation</title>
<link rel="stylesheet" href="style.css">
@tojibon
tojibon / custom-admin.css
Created June 11, 2015 10:06
Saving/Editing user profile photo on WordPress admin
.wp_slrp_img_wrap {
max-width: 160px;
text-align: right;
margin-bottom: 10px;
}
.wp_slrp_img {
display: block;
max-width: 150px;
max-height: 150px;
@tojibon
tojibon / script.js
Last active August 29, 2015 14:23
A Google Spreadsheet Function to count number of cells in a column which all are used selected background colors.
/*
---------------------------------------------------------------------------------------
Returns total number of rows for selected background colors separated by comma, in a column range.
@ param string colors - A set of background hex colors separated by comma. Ex: '#ff0000,#000000,#AEAEAE'
@ param string rangeSpecification - Column field range of rows. Ex: 'E1:E20'
@ return int number of rows with colors listed background colors.
---------------------------------------------------------------------------------------
*/
function countCellsWithBackgroundColors(colors, rangeSpecification) {
@tojibon
tojibon / php-console.php
Created July 27, 2015 02:59
Getting user data via Console Input with PHP.
<?php
function read ($length='255')
{
if (!isset ($GLOBALS['StdinPointer']))
{
$GLOBALS['StdinPointer'] = fopen ("php://stdin","r");
}
$line = fgets ($GLOBALS['StdinPointer'],$length);
return trim ($line);
}
@tojibon
tojibon / IndexController.php
Last active February 18, 2021 21:01
Curl get request in Laravel controller with cache support.
<?php
namespace App\Http\Controllers;
class InfoController extends Controller
{
/*
*
* Checking if cache file exist
* @ param string $name cache file name
@tojibon
tojibon / functions-date.php
Created August 18, 2015 10:47
Get an array of dates with Y-m-d format in between 2 input dates - PHP
<?php
/*
|- Returns an array of dates with Y-m-d format in between 2 input dates
|-
|- @params string $strDateFrom as date("Y-m-d") = "2014-01-01"
|- @params string $strDateTo as date("Y-m-d") = "2014-01-31"
|- @return array() of dates
|-
|- @author: Jewel Ahmed
|- @last modified: 18th Aug, 2015
@tojibon
tojibon / proxy.js
Last active August 26, 2015 05:14
CasperJS script to test proxy ip address using http://ip-addr.es/
var casper = require('casper').create();
casper.start('http://ip-addr.es/', function() {
var doc = this.evaluate(function() {
return document;
});
this.echo(doc.all[0].outerText);
});
casper.run();
@tojibon
tojibon / custom.js
Created August 28, 2015 10:50
Bootstrap inactive broken content for inactive tabs on page load fix
jQuery(document).ready(function ($) {
$('.nav-tabs li a').on('shown.bs.tab', function (e) {
$('.tab-pane').resize();
Calendar.init(); //Reinit JS codes
});
});
@tojibon
tojibon / custom.js
Created September 2, 2015 03:49
Custom module for you to write your own javascript functions
/**
Custom module for you to write your own javascript functions
**/
var Custom = function () {
// private functions & variables
var myFunc = function(text) {
alert(text);
}