Skip to content

Instantly share code, notes, and snippets.

View manobi's full-sized avatar

Gabriel de Oliveira Barbosa manobi

View GitHub Profile
@manobi
manobi / download-images.sh
Last active July 6, 2020 18:40
Baixar imagens
foreach($line in Get-Content .\file.txt) {
if($line -match $regex){
curl -O $line
}
}
@manobi
manobi / docker-plugin.yml
Created June 24, 2020 12:51
Google artifact Registry with Drone
steps:
- name: magento2:latest
image: plugins/docker
settings:
repo: us-central1-docker.pkg.dev/biz-stores/onion/magento2
registry: us-central1-docker.pkg.dev
dockerfile: ./docker/magento2/Dockerfile
use_cache: false
build_args:
- VERSION=2.3.4
@manobi
manobi / index.html
Last active March 2, 2020 17:24
cart io prototype
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
* {padding: 0; margin: 0; text-decoration: none;border: 0; font-family: sans-serif}
.actions {
cursor:pointer;
@manobi
manobi / small-enought.js
Created February 18, 2020 02:21
pure smallEnought version
/**
* pure smallEnought version
* @param {array} a
* @param {number} limit
*/
const smallEnought = ([head, ...tail], limit) => (!head && !tail.length) || ((head > limit) ? false : smallEnought(tail, limit))
@manobi
manobi / auth-0-webtask-io.js
Created February 19, 2019 17:41
FaaS comparison
//https://webtask.io/docs/model
module.exports = function(cb) {
cb(null, { i_am: 'done '});
}
@manobi
manobi / pokedexscript.js
Last active November 27, 2018 02:01
pokedexscript
var modal = document.getElementById('myModal');
var btn = document.getElementById("myBtn");
var span = document.getElementsByClassName("close")[0];
btn.onclick = function () {
modal.style.display = "block";
}
span.onclick = function () {
modal.style.display = "none";
}
window.onclick = function (event) {
@manobi
manobi / dogs-api.spec.js
Created September 20, 2018 00:21
Pollyjs do not persist nor intercept anything
const {expect} = require('chai');
const fetch = require('node-fetch');
const Polly = require('@pollyjs/core').Polly;
const FetchAdapter = require('@pollyjs/adapter-fetch');
const FSPersister = require('@pollyjs/persister-fs');
global.fetch = fetch;
global.Request = fetch.Request;
global.Response = fetch.Response;
@manobi
manobi / bulk_delete.js
Created March 8, 2014 04:10
Bulk delete with cradle
var docs = [
{ _id: 'a82e5e9a093b197960f69dfa17005132',
_rev: '1-70aa8fe77bbe596bded4a9de3aa185e4'
},
{ _id: 'a82e5e9a093b197960f69dfa1700534e',
_rev: '1-70aa8fe77bbe596bded4a9de3aa185e4'
}
]
docs = docs.map(function(doc){
<script id="adlayerScript" async="true" src="//api.adlayerjavascriptsdk.com/page.min.js?page=82e719877b60e205471a9d8ef00564ab&site=82e719877b60e205471a9d8ef0055af6" language="javascript" type="text/javascript" ></script>
require(["helper/util"], function(util) {
//This function is called when scripts/helper/util.js is loaded.
//If util.js calls define(), then this function is not fired until
//util's dependencies have loaded, and the util argument will hold
//the module value for "helper/util".
});