Skip to content

Instantly share code, notes, and snippets.

View lfreneda's full-sized avatar
💙
Always deliver more than expected.

Luiz Freneda lfreneda

💙
Always deliver more than expected.
View GitHub Profile
@lfreneda
lfreneda / colors.md
Last active March 21, 2020 16:08 — forked from irisli/colors.md
Github Flavored Markdown (GFM) Colored text
- all Byzantine agreement protocols, SCP makes no assumptions about the rational behavior of attackers.
- Atenção: Sempre crie sua branch a partir da master
- A não ser que sua funcionalidade dependa de uma mudança estrutural muito grande em outra branch não mergiada :(
@lfreneda
lfreneda / documentação-materiais.js
Last active February 14, 2020 11:35
documentação-materiais.md
(function() { window.location = 'https://developers.fieldcontrol.com.br/#api-field-control'; })();
@lfreneda
lfreneda / mocking_http_angularjs
Created December 19, 2019 13:45
mocking_http_angularjs
describe('HTTP GET', function () {
it("get github username", function () {
var response;
$httpBackend.when('GET', 'https://api.github.com/users/marciofmjr')
.respond(200, {worked: true});
ContaAzulHelper.github().then(function(data) {
response = data;
});
@lfreneda
lfreneda / create_cloudfront_invalidation.js
Created January 2, 2019 15:57
Create Cloudfront Invalidation
const aws = require('aws-sdk')
const moment = require('moment')
const callerReference = moment().format('YYYYMMDDHHmmss')
aws.config.update({
credentials: {
accessKeyId: 'shhhhhhhhhhh',
secretAccessKey: 'shhhhhhhhhhhh'
}
})
const cloudfront = new aws.CloudFront()
@lfreneda
lfreneda / pushNotificatonService.js
Created December 4, 2018 11:23
Push Notification Service
import { Injectable } from '@angular/core';
import {
Platform,
AlertController
} from 'ionic-angular';
import {
Push,
PushObject
} from '@ionic-native/push';
@lfreneda
lfreneda / naming-meh.js
Created October 22, 2018 01:27
Waaaaaaat is this working?!!
async function Bolsonaro2018 (daQEuTeDouOtra, talkei) {
if (talkei && daQEuTeDouOtra) {
const mito = await db['mitos'].brasilAcimaDeTudoDeusAcimaDeTodos({ id: this.robo.id })
if (!mito) {
return null
}
const kitGay = await capitao.vote17(daQEuTeDouOtra, mito.password)
if (!kitGay) {
return null
@lfreneda
lfreneda / js-scrapping-muwhahah.js
Last active January 20, 2018 15:05
getting all startup quote images :P
document.querySelectorAll('.entry img').forEach(function(image) {
var filename = image.alt.replace(/[^\w\s]/gi, '').replace(/\s+/g, '-').toLowerCase() + '.png';
console.log('wget', '-O', filename, image.currentSrc);
});
@lfreneda
lfreneda / integrations-curls-calls.sh
Created November 29, 2017 10:53
integrations-curls-calls.sh
```
curl 'http://api.fieldcontrol.com.br/orders/' -H 'Content-Type: application/json;charset=UTF-8' -H 'x-access-token: seu-token-aqui' --data-binary $'{
"address": {
"zipCode": "05005900",
"city": "Sao Paulo",
"state": "SP",
"street": "Rua Turiassu",
"number": "902",
"complement": null,
"neighborhood": null,
@lfreneda
lfreneda / collapse.js
Last active September 6, 2017 13:17 — forked from dmfay/collapse.js
Collapse JOIN query result sets into a hierarchical object graph
'use strict';
if (!String.prototype.endsWith) {
String.prototype.endsWith = function(searchStr, Position) {
// This works much better than >= because
// it compensates for NaN:
if (!(Position < this.length))
Position = this.length;
else
Position |= 0; // round position
@lfreneda
lfreneda / web-security-checklist.md
Last active July 24, 2017 18:10
web-security-checklist.md