Skip to content

Instantly share code, notes, and snippets.

View MhdAljuboori's full-sized avatar

Mohammed Al-Juboori MhdAljuboori

View GitHub Profile
@MhdAljuboori
MhdAljuboori / README.md
Last active October 17, 2019 14:39
node-sass importer bug
@MhdAljuboori
MhdAljuboori / animator-pro.js
Created November 22, 2015 12:56
AnimatorPro Pinegrow Plugin - v 1.2 - http://animator-pro.mhdaljuboori.me/
/*!
* tram.js v0.8.1-global
* Cross-browser CSS3 transitions in JavaScript
* https://github.com/bkwld/tram
* MIT License
*/
/*!
* P.js
* A lightweight class system. It's just prototypes!
* http:// github.com/jayferd/pjs
$(function() {
function AnimatoinObject (obj, steps, duration, delay, itrations) {
var _this = this;
_this.obj = obj;
_this.steps = steps;
_this.duration = duration;
_this.delay = delay;
_this.itrations = itrations;
/*
* transform: A jQuery cssHooks adding cross-browser 2d transform capabilities to $.fn.css() and $.fn.animate()
*
* limitations:
* - requires jQuery 1.4.3+
* - Should you use the *translate* property, then your elements need to be absolutely positionned in a relatively positionned wrapper **or it will fail in IE678**.
* - transformOrigin is not accessible
*
* latest version and complete README available on Github:
* https://github.com/louisremi/jquery.transform.js
$(function() {
$(document).ready(function () {
for (var i=1; i<=4; i++) {
$('[data-animation-'+i+']').each(function(index, e) {
var trigger = $(e).attr('data-animation-trigger-'+i);
var animationToRemove = $(e).attr('data-animation-to-remove-'+i);
var animationToAdd = $(e).attr('data-animation-type-'+i);
@font-face {
font-family: "Material-Design-Icons";
src: url("https://cdnjs.cloudflare.com/ajax/libs/materialize/0.96.1/font/material-design-icons/Material-Design-Icons.eot?#iefix") format("embedded-opentype"), url("https://cdnjs.cloudflare.com/ajax/libs/materialize/0.96.1/font/material-design-icons/Material-Design-Icons.woff2") format("woff2"), url("https://cdnjs.cloudflare.com/ajax/libs/materialize/0.96.1/font/material-design-icons/Material-Design-Icons.woff") format("woff"), url("https://cdnjs.cloudflare.com/ajax/libs/materialize/0.96.1/font/material-design-icons/Material-Design-Icons.ttf") format("truetype"), url("https://cdnjs.cloudflare.com/ajax/libs/materialize/0.96.1/font/material-design-icons/Material-Design-Icons.svg#Material-Design-Icons") format("svg");
font-weight: normal;
font-style: normal; }
[class^="mdi-"], [class*=" mdi-"] {
font-family: "Material-Design-Icons";
speak: none;
font-style: normal;
@MhdAljuboori
MhdAljuboori / explore.js
Created December 26, 2014 15:24
Explore Folder Using NodeJS
function printRoot (folderPath) {
console.log("----" + folderPath);
sh.cd(folderPath);
var files = sh.ls() || [];
for (var i=0; i<files.length; i++) {
var file = files[i];
if (file.match(/.*\.js/))
console.log(file);
else {
@MhdAljuboori
MhdAljuboori / ng-an-folder.js
Last active August 16, 2019 14:07
NG-Annotate for folder
var sh = require('shelljs');
function annotateFile (filePath) {
console.log('annotate ' + filePath);
sh.exec('ng-annotate -a ' + filePath + ' -o ' + filePath);
}
function annotateFolder (folderPath) {
console.log("annotate Folder " + folderPath);
sh.cd(folderPath);
@MhdAljuboori
MhdAljuboori / parseLog.rb
Last active August 29, 2015 14:10
Parse a Heroku log file and do some analysis on it.
#!/usr/bin/env ruby
## return the average of array
# @arr array of numbers to return its average
def getAverage (arr)
return arr.inject{ |sum, el| sum + el }.to_f / arr.size
end
## return the median of array
# @arr array of numbers to return its median
@MhdAljuboori
MhdAljuboori / search.php
Created September 8, 2014 11:10
WP-Theme Search Result page
<div class="website-content">
<h1><?php printf( __( 'Search Result For: %s', 'YOUR_THEME_NAME' ), '<span>"' . get_search_query() . '"</span>' ); ?></h1>
<div class="search-result">
<?php if ( have_posts() ) : ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink(); ?>"><?php the_title() ?></a>
<?php endwhile; endif; ?>
<?php else: ?>
<h2>
<?php printf( __( 'No Results Found :(', 'YOUR_THEME_NAME' ) ) ?>