Skip to content

Instantly share code, notes, and snippets.

View coder618's full-sized avatar
🎯
Focusing

Ahadul Islam coder618

🎯
Focusing
View GitHub Profile
@coder618
coder618 / fontstyle.scss
Last active February 11, 2018 06:08
Scss Font-Style Mixin
@mixin br-text ( $size: null, $line-h: null, $weight: null ,$c: null, $m: null, $p: null, $f-name: null, $m-b: null,$p-b : null ){
@function str-remove-whitespace($str) {
@while (str-index($str, ' ') != null) {
$index: str-index($str, ' ');
$str: "#{str-slice($str, 0, $index - 1)}#{str-slice($str, $index + 1)}";
}
@return $str;
}
@if($f-name) { font-family: $f-name; }
@if($size) {
@coder618
coder618 / pesudo.scss
Last active January 17, 2018 06:24
Gist For pseudo element
@mixin br-sudo-elemet( $width: null, $height:null, $t:null, $l:null, $b:null, $r:null, $z:null ){
content: " ";
position: absolute;
@if($w) { width: $w ; }
@if($h) { height: $h ; }
@if($z) { z-index: $z ; }
@if($t) { top : $t ;}
@if($b) { bottom :$b ;}
@if($l) { left : $l ;}
@if($r) { right : $r ;}
@coder618
coder618 / theme_variable.scss
Created February 11, 2018 06:10
Bootstrap Theme Variable setup
$primary: #563d7c; // Thats a sample how you could change a BootStrap variable.
$black: #333333;
$green: #44B672;
$balck: #333333;
$dark-gray: #757575;
$light-gray: #ABA7A7;
$gray: #E0E0E0;
$facebook: #3b5998;
// Class toggle for all btn
$('button.btn').on('click', function(){
var ele = ($(this).attr("data-ele-target").length) ? $(this).attr("data-ele-target") : null ;
var class_name = ($(this).attr("data-ele-toggle").length) ? $(this).attr("data-ele-toggle") : null ;
(ele && class_name) ? $(ele).toggleClass(class_name) : null;
});
@coder618
coder618 / _vars-social-colors.scss
Created August 8, 2018 09:21 — forked from koycarraway/_vars-social-colors.scss
Sass color variables for popular brands and social media.
// Social Colors
// ====================================================================
$facebook_color : hsla(222, 47%, 40%, 1); // #365397
$twitter_color : hsla(198, 100%, 47%, 1); // #00a9f1
$linkedin_color : hsla(203, 100%, 35%, 1); // #006db3
$apple_color : hsla(0, 0%, 45%, 1); // #737373
$google_color : hsla(217, 89%, 61%, 1); // #4285f4
$google_plus_color : hsla(8, 74%, 53%, 1); // #e0452c
@coder618
coder618 / word matcher
Created September 29, 2018 08:14
Words matcher
function words_match ($bigStr,$smallStr ){
var match_words = '';
$bigStr = $bigStr.trim();
$smallStr = $smallStr.trim();
if( $smallStr.indexOf(',') > 0 ){
// If string contain multiple item
var sm_array = $smallStr.split(",");
match_words = _.filter( sm_array , function(item) {
@coder618
coder618 / timer
Created October 11, 2018 03:18
js timer
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>time</title>
</head>
<style>
h2{
@coder618
coder618 / gist:ab3aa141d7291379ffa3b9726049a989
Created October 26, 2018 05:27 — forked from hissy/gist:7352933
[WordPress] Add file to media library programmatically
<?php
$file = '/path/to/file.png';
$filename = basename($file);
$upload_file = wp_upload_bits($filename, null, file_get_contents($file));
if (!$upload_file['error']) {
$wp_filetype = wp_check_filetype($filename, null );
$attachment = array(
'post_mime_type' => $wp_filetype['type'],
'post_parent' => $parent_post_id,
@coder618
coder618 / Mobile Navigation
Last active December 22, 2018 06:18
Mobile navigation
/* JS */
$("li.menu-item-has-children > a").on("click", function(e){
e.preventDefault();
var c_item = $(this).siblings('ul')
c_item.toggleClass("d-block")
})
/* MOBILE SCSS */
.main-nav-mobile-container{
wait_timeout=28800
interactive_timeout = 28800
post_max_size = 800M
upload_max_filesize = 800M
max_execution_time = 5000
max_input_time = 5000
memory_limit = 1000M