Skip to content

Instantly share code, notes, and snippets.

View MhdAljuboori's full-sized avatar

Mohammed Al-Juboori MhdAljuboori

View GitHub Profile
@MhdAljuboori
MhdAljuboori / Draw OpenGL
Created May 20, 2012 18:59
Draw not moving thing in OpenGL
/************** main.cpp **************/
int InitGL(GLvoid) {
......
myClass = new myClass();
myClass->Draw(pos);
......
}
int DrawGLScene(GLvoid) {
......
@MhdAljuboori
MhdAljuboori / Connect 4
Created May 20, 2012 19:01
AI homework
initializeColumn(Column) :-
Column >0,
% create empty table
assert(top(Column, 1)),
Column1 is Column-1,
initializeColumn(Column1).
initializeColumn(0).
% Create Game with Row equal to row and column equal to column
createGame(Row, Column) :-
@MhdAljuboori
MhdAljuboori / Muukii.tmTheme
Created August 26, 2014 09:29
Muukii - Sublime Theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- Generated by: TmTheme-Editor -->
<!-- ============================================ -->
<!-- app: http://tmtheme-editor.herokuapp.com -->
<!-- code: https://github.com/aziz/tmTheme-Editor -->
<plist version="1.0">
<dict>
<key>gutterSettings</key>
<dict>
@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' ) ) ?>
@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 / 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 / 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 {
@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;
$(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);
/*
* 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