This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Math.gcd = function () { | |
var d = Math.min.apply(Math, arguments); | |
for (let n = arguments.length, i = 0; d > 1 && n > i; arguments[i] % d === 0 ? i++ : (d--, i = 0)); | |
return d; | |
} | |
console.log(Math.gcd(20, 30, 15, 70, 40)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create an immediately invoked functional expression to wrap our code | |
(function() { | |
// Define our constructor | |
this.Modal = function() { | |
// Create global element references | |
this.closeButton = null; | |
this.modal = null; | |
this.overlay = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var factorial = function(n) { | |
if(n == 0) { | |
return 1 | |
} else { | |
return n * factorial(n - 1); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Agents list page */ | |
.agents-listing { | |
&.grid-property { | |
p{ | |
margin-top: 5px; | |
text-align: right; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sass/ | |
| | |
|– abstracts/ | |
| |– _variables.scss # Sass Variables | |
| |– _functions.scss # Sass Functions | |
| |– _mixins.scss # Sass Mixins | |
| |– _placeholders.scss # Sass Placeholders | |
| | |
|– base/ | |
| |– _reset.scss # Reset/normalize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function binary(n){ | |
var stac = []; | |
while(n > 0){ | |
remainder = n%2; | |
stac.push(remainder); | |
n = Math.floor(n/2); | |
} | |
console.log(stac.reverse()) | |
var count = 0; | |
stac.forEach((t,i)=>{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function breakStr(string, count) { | |
//return [...string.slice(count - 1)].map((_, i) => string.slice(i, i + count)); | |
return [Array.from(string).slice(count - 1)].map((_, i) => string.slice(i, i + count)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.config(function ($stateProvider, $urlRouterProvider){ | |
$urlRouterProvider.otherwise("/home"); | |
$stateProvider | |
//------------------------------ | |
// HOME | |
//------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Select all children from the first to `$num`. | |
/// @group with-arguments | |
/// @content [Write the style you want to apply to the children, and it will be added within the @content directive] | |
/// @param {number} $num - id of the child | |
@mixin first($num) { | |
&:nth-child(-n + #{$num}) { | |
@content; | |
} | |
} |