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 child theme stylesheets enqueue
add_action( 'wp_enqueue_scripts', 'mondira_child_theme_css' );
function mondira_child_theme_css() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style', get_stylesheet_uri(), array( 'parent-style' ) );
}
@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 / 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 / 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 / remove.bat
Created September 10, 2015 10:14
Removing everything from a directory which has a lot of long named files and directory in Windows Command Prompt
mkdir tpm_empty_dir
robocopy tpm_empty_dir the_dir_to_make_empty /s /mir
rmdir tpm_empty_dir
@tojibon
tojibon / get_location_info_by_google_map.php
Created September 10, 2015 10:51
Get location info by google latitude and longitude via Google Map API and CURL
<?php
/*
Get location info by google latitude and longitude via Google Map API and CURL
You may need to change the proxy ip:port and auth username:pass or keep them empty.
*/
/*
*
* @ param string $url as 'http://maps.google.com'; Page url location which you want to fetch
* @ param string $proxy [optional] as '[proxy IP]:[port]'; Proxy address and port number
@tojibon
tojibon / gruntfile.js
Created September 12, 2015 19:18
Grunt CSS Minify Example
module.exports = function(grunt){
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
cssmin: {
my_target: {
files: [{
expand: true,
cwd: 'css/',
src: ['*.css', '!*.min.css'],
@tojibon
tojibon / gruntfile.js
Last active September 12, 2015 19:41
Grunt JS Minify Example
module.exports = function(grunt){
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
manage: false
},
my_target: {
files: [{