Skip to content

Instantly share code, notes, and snippets.

View valterbarros's full-sized avatar
👊
Code makes me happy

Valter Barros valterbarros

👊
Code makes me happy
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DocumentDetector</title>
<script src="https://repo.combateafraude.com/javascript/release/document-detector/5.4.0.umd.js"></script>
<script>
const getCafToken = async () => {
import { useEventListener } from '@vueuse/core';
import { computed, ref, watch } from 'vue';
import { useI18n } from '@/locales';
/** twilio message limit */
export const MAX_LENGTH = 200;
export const testingWatch = (maxLengthGeneral, form) => {
watch(form, (val1) => {
const gt = val1.name.length + val1.content.length >= MAX_LENGTH;
@valterbarros
valterbarros / testing-mutation-observer-2.test.js
Created January 27, 2023 16:34
mock mutation observer and use on jest test
const mockMutationObserver = function() {
observerDomChangesCaf.mockImplementation((_, errorCallback) => {
console.log('observerDomChangesCaf');
errorCallback();
});
const el = document.createElement('div');
useMutationObserver.mockImplementation((_, callback) => {
const mut = new MutationObserver(callback);
const orig = EventTarget.prototype.dispatchEvent;
EventTarget.prototype.dispatchEvent = function(...args) {
console.log('dispatch event', args)
return orig.apply(this, args);
}
var signalingChannel = new SignalingChannel();
var pc = new RTCPeerConnection({});
navigator.getUserMedia({ "audio": true }, gotStream, logError);
function gotStream(stream) {
pc.addStream(stream);
pc.createOffer(function(offer) {
pc.setLocalDescription(offer);
class OldCaf {
constructor(param) {
const SdkImport = window.PassiveFaceLivenessSdk;
this._sdk = new SdkImport(param);
}
open() {
}
@valterbarros
valterbarros / robbyrussell-custom.zsh-theme
Last active March 11, 2022 14:02
A oh my zsh theme that resume path string
# As that shows in the terminal: ~/../js/BR-OUROV-ITB-VERDE-SFCC <develop-ativos>
# installing
# on linux
# curl https://gist.githubusercontent.com/valterbarros/55df836e6ea5989bc15052a253c874e4/raw/9c9a73560244f3a520d6f85ad0e15c7f73cfa319/robbyrussell-custom.zsh-theme > $ZSH/themes/robbyrussell-custom.zsh-theme
# see instructions to set the theme https://github.com/ohmyzsh/ohmyzsh#selecting-a-theme
# set theme just for the current terminal instance: ZSH_THEME="robbyrussell-custom"
function return_status() {
echo "%(?..👾)"
!`:: ; Next window
curr := WinExist("A")
WinGet currentProcessName, ProcessName, % "ahk_id " curr
WinGet, WinClassCount, Count, % "ahk_exe " currentProcessName
;MsgBox, %currentProcessName%
IF WinClassCount = 1
Return
ElSE
================================
trailhead.salesforce.com
CSS
.search-input__input {
background-color: var(--darkreader-neutral-background) !important;
}
.user-info__name {
color: inherit !important;
This file has been truncated, but you can view the full file.
[
[
{
"title": "Salesforce B2C Commerce 21.10",
"href": "topic/com.demandware.dochelp/content/b2c_commerce/topics/getting_started/b2c_welcome.html?cp=0",
"isLeaf": false
},
{
"title": "Welcome to the Salesforce B2C Commerce Infocenter",
"href": "topic/com.demandware.dochelp/content/b2c_commerce/topics/getting_started/b2c_welcome.html?cp=0_0",