Skip to content

Instantly share code, notes, and snippets.

View LucasBadico's full-sized avatar

Lucas Badico LucasBadico

View GitHub Profile
curl -v https://api.sandbox.paypal.com/v1/payments/payment \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer A21AAG_sHaCrvQURWObVETp38N6Hres90O6oo8lbrMQBe9YhlODYYni_gx1H8LCF_m97NcmoUmOJ2DB0c2E7HATqyDkDNMagQ' \
-d '{
"intent":"sale",
"payer":{
"payment_method":"paypal"
},
"transactions":[
{
if (pluginHelper.startsWith(givenPath, '$/')) {
path.node.source.value = pluginHelper.transformReflectiveToRootPath(
givenPath,
state.file.opts.filename,
rootPathSuffix,
testFolder,
);
}
@LucasBadico
LucasBadico / curry.js
Last active June 13, 2018 19:14
Curry
// versao sem curry
function fatiar(prato1, prato2, prato3, prato4, pizza) { // nossa pizza aqui é de pedaçoes grandes
return [
{
[prato1]: pizza/4
},
{
[prato2]: pizza/4,
},
@LucasBadico
LucasBadico / CombineShape.js
Created June 19, 2018 15:08
Combine of composer
// essa funcao receber n numeros of shapes
// cada shape com posicao e seu centro
// e devolvera um array bidimencional
const dot = [
[1]
]
const square = [
[1, 1 ],
[1, 1],
@LucasBadico
LucasBadico / backoffice-header.js
Last active October 1, 2019 16:57
backoffice-header.react16.js
import React from 'react';
export function BackofficeHeader(props) {
return <div>
<h1>{props.title}</h1>
<p class="subtitle"> {props.subtilte || ''} </p>
{props.children}
</div>
}
@LucasBadico
LucasBadico / backoffice-header.vue
Last active October 1, 2019 17:16
vue component
<script>
export default {
name: "backoffice-header",
props: { title: { type: String, required: true }, subtitle: { type: String, required: false, default: '' } }
}
</script>
<template>
<h1> {{title}}</h1>
<p class="subtitle"> {{subtitle}}</p>
<slot></slot>
import React from 'react';
export class BackofficeHeader extends React.Component {
render() {
const {props} = this
return <div>
<h1>{props.title}</h1>
<p class="subtitle"> {props.subtilte || ''} </p>
{props.children}
@LucasBadico
LucasBadico / backoffice-header.js
Created October 1, 2019 17:29
webcomponent sample
import { LitElement, html } from 'lit-element';
class BackofficeHeader extends LitElement {
static get properties() {
return {
title: String,
subtitle: String,
};
}
render(){
import { GarageRepo, GarageService } from '../../src';
describe('Garage Service test', () => {
it('should GarageService be defined', () => {
expect(GarageService).toBeDefined();
});
})
export default class GarageRepo {
constructor(mysql, redis) {
this.mysql = mysql;
this.redis = redis;
}
}