Skip to content

Instantly share code, notes, and snippets.

View myasseen's full-sized avatar

Mahmoud Yasseen myasseen

View GitHub Profile
@myasseen
myasseen / Cross-browser-images-greyscale.css
Last active August 29, 2015 13:57
Cross browser images greyscale
body{
padding: 50px 10px;
}
img{
border: 10px solid #ccc;
box-shadow: 0px 0px 1px #555;
}
img.grayscale{
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
filter: gray; /* IE6-9 */
<?php
/**
* Change Upload Directory for one Custom Post-Type
*
* This will change the upload directory for a custom post-type. Attachments for this custom post type will
* now be uploaded to a seperate "uploads" directory. Make
* sure you swap out "post-type" and the "my-dir" with the appropriate values...
* credits to: http://wordpress.stackexchange.com/users/4044/jhdenham
* and http://yoast.com/smarter-upload-handling-wp-plugins/
*/
@myasseen
myasseen / form.js
Last active August 29, 2015 14:11 — forked from dhcole/form.js
Submit data from html form to Google Doc Spreadsheet. Uses Bootstrap components for auto-complete region list and date selection.
$(function(){
var formUrl = '/* ex: https://docs.google.com/a/developmentseed.org/spreadsheet/formResponse?formkey=... */';
// Set up map
var m = mapbox.map('map').addLayer(mapbox.layer().id(' /* mapbox-account.id */ '));
// Set up map ui features with point selector
var ui = mapbox.ui().map(m).auto().pointselector(function(d) {
// Remove all points except the most recent
@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);
@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 / 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 / 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 / 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 / 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;
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) {