Skip to content

Instantly share code, notes, and snippets.

View MuhammedMahdy's full-sized avatar

MuhammedMahdy MuhammedMahdy

View GitHub Profile
function scrollDown(selector,speed){
var n = $(selector)[0].scrollHeight;
$(selector).animate({ scrollTop: n }, speed);
}
.margin-left{20px;}
.margin-right{20px;}
.margin-top{20px;}
.margin-bottom{20px;}
.padding-left{20px;}
.padding-right{20px;}
.padding-top{20px;}
.padding-bottom{20px;}
<script type="text/javascript">
$(function(){
$('.signUp').validate({
onfocusout: function (element) {
validateWrap($(element).valid(),element);
},
rules:{
username:{required:true, email: true},
password:{required:true}
},
@MuhammedMahdy
MuhammedMahdy / gist:03a67e4d24747eb18aab61d9837d8ea6
Created November 8, 2016 16:17
cabsola thumb image holder
site_url('assets/plugins/cabsola-template/images/dummey/10.jpg')
@MuhammedMahdy
MuhammedMahdy / Contact.php
Last active November 8, 2016 17:17
open graph
<?php
/**
* Created by PhpStorm.
* User: Mohamed
* Date: 10/25/2016
* Time: 1:12 PM
* @property Output_view $output_view
*
*/
@MuhammedMahdy
MuhammedMahdy / package.json
Created August 29, 2016 06:02
json: npm package example
{
"name": "tutsplus-jquery-plugins",
"version": "1.0.0",
"description": "Project for jQuery Plugins Course",
"scripts": {
"dev": "lite-server"
},
"author": "",
"license": "ISC",
"devDependencies": {
@MuhammedMahdy
MuhammedMahdy / jquery.zoomInput.js
Created August 28, 2016 05:17
jquery plugin template
;
"use strict";
(function ($) {
// the default settings
var defaults = {
};
function ZoomInput(element, options) {
@MuhammedMahdy
MuhammedMahdy / jquery.dateRange.js
Created August 26, 2016 18:57
javascript: dates process object
var dates = {
convert:function(d) {
// Converts the date in d to a date-object. The input can be:
// a date object: returned without modification
// an array : Interpreted as [year,month,day]. NOTE: month is 0-11.
// a number : Interpreted as number of milliseconds
// since 1 Jan 1970 (a timestamp)
// a string : Any format supported by the javascript engine, like
// "YYYY/MM/DD", "MM/DD/YYYY", "Jan 31 2009" etc.
// an object : Interpreted as an object with year, month and date
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">