Skip to content

Instantly share code, notes, and snippets.

View myasseen's full-sized avatar

Mahmoud Yasseen myasseen

View GitHub Profile
@myasseen
myasseen / script.js
Last active February 27, 2016 20:29 — forked from Mestika/script.js
Fix "backdrop" height on tall modal in Bootstrap (require jQuery)For tall modals in Bootstrap, the backdrop (background) doesn't always go all the way down because of how Bootstrap is setting the height.Instead, set the backdrop height equal to the modal-content and correct for the window height.
$('body').on('shown.bs.modal', '.modal', function(){
var windowHeight = parseInt($(window).height());
var height = parseInt($('.modal-content').height());
if(windowHeight > height) height = windowHeight;
//the 60 ekstra pixels is to correct for the margin top and button of the modal when initiated
$('.modal-backdrop').height(height+60);
});
@myasseen
myasseen / styles.css
Last active August 29, 2015 14:22 — forked from pburtchaell/styles.css
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<?php $i=1; while(has_sub_field('sections')) : ?>
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="heading-<?php echo $i; ?>">
<h2 class="panel-title">
<a data-toggle="collapse" data-parent="#accordion" href="#collapse-<?php echo $i; ?>" aria-expanded="true" aria-controls="collapseOne">
<?php the_sub_field('heading'); ?>
</a>
</h2>
</div>
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
@myasseen
myasseen / Table-Columns-with-Alternating-Colors-using-CSS3.css
Created February 11, 2015 09:09
Table Columns with Alternating Colors using CSS3
.tableCol{
width:100%;
border-collapse:collapse;
}
.tableCol td{
padding:7px; border:#4e95f4 1px solid;
}
/* improve visual readability for IE8 and below */
.tableCol tr{
background: #b8d1f3;
@myasseen
myasseen / SublimeText3-Keyboard-Shortcuts_Mac-OSX.rst
Last active August 29, 2015 14:15
Sublime Text 3 Keyboard Shortcuts - Mac OSX

Sublime Text 3 Keyboard Shortcuts - Mac OSX

Warning

This topic is a draft and may contain wrong information.

Editing

@myasseen
myasseen / Disable-wpautop.php
Created February 10, 2015 22:02
Disable WordPress "wpautop" on specific posts/pages!
<?php
/*
* Plugin Name: Disable wpautop
* Plugin URI: http://masterscene.com
* Author: Mahmoud Yasseen
* Author URI: http://masterscene.com
* Version: 1.1
* Description: Disable wpautop on posts/pages with custom field 'wpautop' == false.
*/
@myasseen
myasseen / CSS-Ordered-List-without-the-Period.css
Last active August 29, 2015 14:15
CSS: Ordered List without the Period.
/*Solution 1 (Recommended)*/
ol {
counter-reset: item;
list-style-type: none;
}
li {
display: block;
}
@myasseen
myasseen / SublimeText3-Keyboard-Shortcuts_Windows-Linux.rst
Last active August 29, 2015 14:15
Sublime Text 3 Keyboard Shortcuts - Windows/Linux

Sublime Text 3 Keyboard Shortcuts - Windows/Linux

Warning

This topic is a draft and may contain wrong information.

Editing

@myasseen
myasseen / bootstrap-sass-mixin-cheatsheet.scss
Last active June 20, 2017 16:07 — forked from anthonyholmes/bootstrap-sass-mixin-cheatsheet.scss
Bootstrap SCSS Mixins and Modifications
// Alerts
@include alert-variant($background, $border, $text-color);
// Background Variant
@include bg-variant($parent, $color);
// Border Radius
@include border-top-radius($radius);
@include border-right-radius($radius);
@include border-bottom-radius($radius);