Skip to content

Instantly share code, notes, and snippets.

View teknotica's full-sized avatar
✌️

Silvia Rebelo teknotica

✌️
View GitHub Profile
@teknotica
teknotica / remove-duplicates.js
Created February 14, 2019 09:35
Remove duplicates from Array
const arr = [6, 8, 10, 2, 5, 6, 13, 11, 8, 0, 11, 11, 3, 5, 100, 100, 78];
Array.prototype.removeDuplicates = function () {
let arr = this;
// Sort array first
arr.sort(function(a, b) {
return a - b;
});
@teknotica
teknotica / angular-classes.html
Created January 4, 2016 17:31
Different ways of setting ng-class
<div ng-class="[{'class': someFunction()}, variable]"></div>
@teknotica
teknotica / gist:5f0faf632ee0c8282f42
Last active September 13, 2018 16:50
LESS loop
@bulletcolours:
black @color-black,
blue @color-blue,
red @color-red,
green @color-green,
yellow @color-yellow,
navy @color-navy,
orange @color-orange,
grey @color-grey;
@teknotica
teknotica / _animations.scss
Created October 7, 2015 11:19
SCSS Animations Utils
@include keyframes(fadeIn) {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@teknotica
teknotica / iframe.js
Last active October 7, 2015 11:18
Dynamically loading iframe to print
function prepareIframe(src) {
var iframeDocument, iframeContent;
var iframe = document.getElementById("iframe-print");
if (!iframe || !src) {
return;
}
iframe.src = src;
@teknotica
teknotica / ratio.scss
Last active August 29, 2015 14:23
SASS snippet to keep ratio of element
.wrapper {
display: inline-block;
position: relative;
&:after {
content: "";
padding-top: 56.25%; // Use 100% for square ratio
display: block;
}