Skip to content

Instantly share code, notes, and snippets.

View myasseen's full-sized avatar

Mahmoud Yasseen myasseen

View GitHub Profile
// Helper classes.
@each $property in (border, margin, padding) {
@each $direction in ('', -left, -right, -top, -bottom) {
.#{$property}#{$direction} {
@if $property == border {
#{$property}#{$direction}: 1px solid $gray-lighter;
}
@else {
#{$property}#{$direction}: 1em;
}
@myasseen
myasseen / bootstrap-masonry-template.htm
Created July 28, 2016 14:46 — forked from justincarroll/bootstrap-masonry-template.htm
This is my template for using Masonry 3 with Bootstrap 3. For those of you who follow this gist a lot has changed since Bootstrap 2.
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Masonry Template</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700">
@myasseen
myasseen / wp_mail_smtp.php
Created March 4, 2016 15:35 — forked from butlerblog/wp_config.php
Configure WordPress wp_mail function to send through SMTP server http://b.utler.co/Y3
/**
* This function will connect wp_mail to your authenticated
* SMTP server. This improves reliability of wp_mail, and
* avoids many potential problems.
*
* Author: Chad Butler
* Author URI: http://butlerblog.com
*
* For more information and instructions, see:
* http://b.utler.co/Y3
/**
*
* Gulpfile setup
*
* @since 1.0.0
* @authors Ahmad Awais, @digisavvy, @desaiuditd, @jb510, @dmassiani and @Maxlopez
* @package neat
* @forks _s & some-like-it-neat
*/
@myasseen
myasseen / test.php
Created February 2, 2016 22:49 — forked from madan712/test.php
PHP example - Google Recaptcha validation using jquery (AJAX)
<?php
$remoteip = $_SERVER['REMOTE_ADDR'];
?>
<!doctype html>
<html>
<head>
<title> Recaptcha validation using jquery ajax </title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript" src="recaptcha_ajax.js"></script>
<script type="text/javascript">
@myasseen
myasseen / maybe-include-plugin.php
Created January 18, 2016 13:04 — forked from alexkingorg/maybe-include-plugin.php
Conditional loading of a plugin within a WordPress theme.
<?php
// Run this code on 'after_theme_setup', when plugins have already been loaded.
add_action('after_setup_theme', 'my_load_plugin');
// This function loads the plugin.
function my_load_plugin() {
// Check to see if your plugin has already been loaded. This can be done in several
// ways - here are a few examples:
@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>