Skip to content

Instantly share code, notes, and snippets.

View lucasdu4rte's full-sized avatar
🌎

Lucas Duarte lucasdu4rte

🌎
View GitHub Profile
const produtos = [
{
nome: 'Bicicleta',
preco: 1200.0
},
{
nome: 'Capacete',
preco: 450.0
}
]
const produtos = [
{
id: 1,
preco: 10.0,
qtd: 2
},
{
id: 2,
preco: 10.0,
qtd: 2
const produtos = [
{
id: 1,
preco: 10.0,
qtd: 2
},
{
id: 2,
preco: 10.0,
qtd: 6
const produtos = [
{
id: 1,
preco: 10.0,
qtd: 2
},
{
id: 2,
preco: 10.0,
qtd: 6
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@lucasdu4rte
lucasdu4rte / adaptativeDatetimePicker.js
Created February 6, 2018 11:02
Change attrs directive on AngularJS
"use strict";
angular.module('app').directive('adaptativeDatetimePicker', function($http, $rootScope, $document, $window, $compile) {
return {
priority:1001, // compiles first
terminal:true, // prevent lower priority directives to compile after it
compile: function(el, attrs) {
if ($window.innerWidth <= 768) {
el.removeAttr('adaptative-datetime-picker'); // necessary to avoid infinite compile loop
el.removeAttr('data-smart-masked-input');
@lucasdu4rte
lucasdu4rte / juros_simples.js
Created February 26, 2018 03:15
Juros Simples
var juros_simples = function(capital, taxa, n_periodos) {
return capital * taxa * n_periodos;
}
@lucasdu4rte
lucasdu4rte / isOdd.js
Created February 26, 2018 03:19
função verifica se é impar
function isOdd(num) { return num % 2 !== 0;}
@lucasdu4rte
lucasdu4rte / Random-string
Created March 1, 2018 13:43 — forked from 6174/Random-string
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
<div ng-app="myApp" ng-controller="MyCtrl">
<div after-render="missionCompled">element</div>
</div>