Skip to content

Instantly share code, notes, and snippets.

View mateusmiguel's full-sized avatar

Mateus Miguel mateusmiguel

View GitHub Profile
let obj1 = {
page: 1,
per_page: 3,
total_records: 6,
data: [
{_id: "01"},
{_id: "02"},
{_id: "03"},
],
};
@mateusmiguel
mateusmiguel / library.scss
Created October 30, 2019 14:19 — forked from certainlyakey/library.scss
URL-encode color SASS function / convert color to hex SASS function
//does not work with colors containing alpha
@function encodecolor($string) {
@if type-of($string) == 'color' {
$hex: str-slice(ie-hex-str($string), 4);
$string:unquote("#{$hex}");
}
$string: '%23' + $string;
@return $string;
}
import java.util.Arrays;
public class CadastroAlunos {
public static void main(String args[]) {
String[] Alunos = new String[25];
for (int i = 0; i < 25; i++) {
Alunos[i] = "Aluno " + (i + 1);
}
String[] MaisAlunos = Arrays.copyOf(Alunos, 30);
for (int i = 25; i < 30; i++) {
import java.util.*;
import java.util.LinkedList;
import java.util.Queue;
public class atv3 {
public static void main(String[] args) {
// Declaração de variáveis do projeto
int i;
@mateusmiguel
mateusmiguel / checkArray.js
Created August 4, 2019 22:50
Check if element exists in array
function findAnimal(list, animal) {
return list.indexOf(animal) !== -1;
}
var animals = ["Dog", "Cat", "Bear"];
findAnimal(animals, "Dog")
@mateusmiguel
mateusmiguel / arrow.js
Created July 2, 2019 20:57
small arrow expression
let Layla = 'dog'
let Ted = 'bear'
isDog = (animal) => animal === 'dog'
console.log(isDog(Layla))
console.log(isDog(Ted))
@mateusmiguel
mateusmiguel / destructingArray.js
Created February 20, 2018 20:10
Array destructuring
var fruits = ["apple", "strawberry", "orange"]
console.log(fruits)
var [ ,morango, laranja] = fruits
console.log(morango)
console.log(laranja)
@mateusmiguel
mateusmiguel / scroll.js
Last active October 2, 2017 23:18
Efeito de scroll simples com JS.
//Scroll
$('a[href^="#"]').on('click', function (event) {
var target = $(this.getAttribute('href'));
if (target.length) {
event.preventDefault();
$('html, body').stop().animate({
scrollTop: target.offset().top
}, 1000);
}
});
@mateusmiguel
mateusmiguel / font.txt
Created August 24, 2017 13:12
find fonts on google
Proxima-Nova "parent directory" otf OR ttf OR fonts -html -htm -download -links