Skip to content

Instantly share code, notes, and snippets.

View HiroAgustin's full-sized avatar
😰

Agustín Díaz HiroAgustin

😰
View GitHub Profile
function isFactorial(number) {
let total = counter = 1
while (total < number)
total *= counter++
return total === number
}
function shuffle (array) {
let remaining = array.length
// While there remain elements to shuffle.
while (remaining) {
// Pick a remaining index.
let index = Math.floor(Math.random() * remaining--)
// And swap it with the current element.
let item = array[remaining]
@HiroAgustin
HiroAgustin / Sharing.js
Created December 18, 2014 17:38
Include facebook, twitter and analytics scripts.
;(function (win, doc, s, js, fjs, inc, ga)
{
'use strict';
fjs = doc.getElementsByTagName(s)[0];
inc = function (src)
{
js = doc.createElement(s);
js.src = src;
@HiroAgustin
HiroAgustin / rotate.scss
Last active January 1, 2016 06:38
Position x elements in a circle.
$elementsCount: 12;
$angle: 360deg / $elementsCount;
@for $i from 0 through $elementsCount - 1 {
.rotation-#{$i} {
transform: rotate($i * $angle + 90deg);
}
}
@HiroAgustin
HiroAgustin / indifference.js
Created November 11, 2013 23:22
Script para poner "No Contesta" en todos los campos de la evaluación de estudiante de la ORT.
Array.prototype.forEach.call(document.querySelectorAll('td:last-child>input[type="radio"]'), function (input) {
input.setAttribute('checked');
});