Skip to content

Instantly share code, notes, and snippets.

View hsleonis's full-sized avatar
🏝️
Travellers unite.

Hasan Shahriar hsleonis

🏝️
Travellers unite.
View GitHub Profile
@hsleonis
hsleonis / select-without-expand.scss
Created March 31, 2016 10:49 — forked from delphinpro/select-without-expand.scss
Remove expand arrow in select-element
select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
&::-ms-expand { display: none; }
}
@hsleonis
hsleonis / tel-geo-url.html
Last active April 22, 2026 10:02
Telephone and geo location map link in html
Telephone link:
(Reference: http://code.tutsplus.com/tutorials/mobile-web-quick-tip-phone-number-links--mobile-7667)
Android and iOS automatically detect phone numbers with specific format.
(555) 555-5555 (Android + iPhone)
555 555 5555 (Android + iPhone)
555.555.5555 (Android + iPhone)
<!-- Embedded within normal page text -->
<p>If you'd like to talk, <a href="tel:5555555">Call Me!</a></p>
@hsleonis
hsleonis / http-equiv-attribute.html
Last active March 31, 2016 05:35
Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header.
* This example causes the browser to reload the document every two seconds.
<meta http-equiv="refresh" content="2">
* This example sets the character set for the document.
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
* This example disables theme support for the document.
@hsleonis
hsleonis / ie-8-support.html
Created March 31, 2016 04:30
IE < 9 Support, HTML5 for you know what and respond js is a fast & lightweight polyfill for min/max-width CSS3 Media Queries (for IE 6-8, and more)
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
@hsleonis
hsleonis / jquery-ie.html
Created March 31, 2016 04:08
JQuery best practice for IE
<!--
f your web site needs oldIE support, and we expect most sites will need it for at least another year or two,
you can use IE conditional comments to include version 1.9 only when visitors are using oldIE:
Reference: https://blog.jquery.com/2012/06/28/jquery-core-version-1-9-and-beyond
-->
<!--[if (!IE)|(gt IE 8)]><!-->
<script src="js/jquery-2.1.3.min.js"></script>
<!--<![endif]-->
@hsleonis
hsleonis / wp-theme-modification.php
Last active March 30, 2016 09:43
WP Theme Modification API
<?php
/**
* Retrieves a modification setting for the current theme
* Get, set or remove values of theme customizer
*
* Functions
* get_theme_mod()
* get_theme_mods()
* set_theme_mod()
* remove_theme_mod()
@hsleonis
hsleonis / wp-theme-customizr.php
Created March 30, 2016 08:43
WP theme customizer section
<?php
/**
* Adds the individual sections, settings, and controls to the theme customizer
* Reference: https://codex.wordpress.org/Theme_Customization_API
*/
function tmx_theme_customizer( $wp_customize ) {
$wp_customize->add_section(
'social_section',
array(
'title' => 'Social Links',
<?php
/**
* The Transients API is very similar to the Options API but with the added feature of an expiration time,
* which simplifies the process of using the wp_options database table to temporarily store cached information.
* Reference: https://codex.wordpress.org/Transients_API
*/
// Get any existing copy of our transient data
if ( false === ( $special_query_results = get_transient( 'special_query_results' ) ) ) {
// It wasn't there, so regenerate the data and save the transient
@hsleonis
hsleonis / wp-basic-widget.php
Last active March 30, 2016 05:37
Wordpress widget
<?php
/**
* Extend WP_Widget class,
*
* Reference:
* https://codex.wordpress.org/Widgets_API
* https://codex.wordpress.org/Function_Reference/the_widget
*/
// Creating the widget
@hsleonis
hsleonis / wp-admin-dashboard-widget.php
Created March 30, 2016 04:53
WP add a widget to the dashboard
<?php
/**
* Add a widget to the dashboard.
*
* This function is hooked into the 'wp_dashboard_setup' action below.
* Reference: https://codex.wordpress.org/Dashboard_Widgets_API
*/
function example_add_dashboard_widgets() {
wp_add_dashboard_widget(