Skip to content

Instantly share code, notes, and snippets.

View NouranMahmoud's full-sized avatar
✈️
New Life Challenges! - تحديات جديدة

Nouranology NouranMahmoud

✈️
New Life Challenges! - تحديات جديدة
View GitHub Profile
module.exports = function(grunt) {
grunt.initConfig({
jade: {
compile: {
options: {
client: false,
pretty: true
},
files: [ {
expand: true,
requirejs = require('./node_modules/requirejs/bin/r.js')
baseConfig =
baseUrl: "./war/scripts/app"
locale: "en-us"
optimize: "uglify"
preserveLicenseComments: false
name: "almond"
findNestedDependencies: true
wrap: true
paths:
@NouranMahmoud
NouranMahmoud / Branching singleton pattern
Created June 17, 2015 16:29
Branching is a technique that allows you to encapsulate browser differences into dynamic methods that get set at run-time. Once the initialization is complete, each browser only executes the code specific to its implementation of Javascript.
/* SimpleXhrFactory signleton, step2 */
var SimpleXhrFactory = (function(){
//The three branches.
var standard = {
createXhrObject: function(){
return new XMLHttpRequest();
}
};
var activeXNew = {
createXhrObject: function(){
@NouranMahmoud
NouranMahmoud / Great Common Factor(divisor).js
Last active March 31, 2020 04:30
Two ways with Two functions to calculate the GCF for (two numbers) only.
/*
Greatest Common Factor
GCF function takes two numbers and generates the greatest common factor.
*/
function GCF(num1, num2) {
var arr1 = findFactors(num1);
var arr2 = findFactors(num2);
@NouranMahmoud
NouranMahmoud / Least Common Multiple.js
Last active December 30, 2018 10:17
Least Common Multiple (LCM)
// Least Common Multiple
function LCM(n, m, range) {
var list1 = [];
var list2 = [];
var match;
for(var i = 1; i <= range; i++) {
list1.push(n*i)
import Ember from 'ember';
export default Ember.Component.extend({
});
[percy:config] Found config file: .percy.json (0ms)
[percy:config] Using config:
{
version: 2,
snapshot: {
widths: [
375,
1280,
1920