Skip to content

Instantly share code, notes, and snippets.

@bcamargogui
bcamargogui / convert-body-to-base64.js
Created August 9, 2023 18:06
Postman pre-request script convert body to base64 - Commercetools
// Convert part of the body to base64 (same format as messages)
var data = JSON.parse(pm.request.body.raw);
const newBody = {
...data,
message: {
data: Buffer.from(JSON.stringify(data.message.data)).toString('base64'),
}
};
@bcamargogui
bcamargogui / cobasi-mail-for-linux
Created September 28, 2020 13:31
Native cobasi mail app for linux
# Using https://github.com/jiahaog/nativefier
nativefier \
--name cobasi-mail-for-linux \
--ignore-certificate \
--insecure \
--show-menu-bar \
--tray start-in-tray \
--single-instance \
mailnew.cobasi.com.br
@bcamargogui
bcamargogui / workplace-linux-app
Created September 28, 2020 13:28
Native workplace linux app
# Using https://github.com/jiahaog/nativefier
nativefier \
--name workplace-for-linux \
--show-menu-bar \
--single-instance \
--tray start-in-tray \
work.workplace.com
enum SquarePossibilities {
X = 'X',
O = 'O',
}
type SquareType = SquarePossibilities | null;
/**
* Return winner from tic tac toe game
* @argument squares: SquareType[]
function getStringPermutation(letters = '') {
const lettersLength = letters.length;
// not able to permut
if (lettersLength < 2) return letters;
// break letters to array
const lettersParts = letters.split('');
// only option to permut
if (lettersLength === 2) {
// reverse letters order string
const reversedLetters = lettersParts.reverse().join('');
@bcamargogui
bcamargogui / autoLike.js
Created October 5, 2019 05:23
tinder like almost everyone trick
// High variables
const interval = 500
const qsLike = '[aria-label="Like"]'
const qsUnlike = '[aria-label="Nope"]'
const qsOpenCard = '.recCard'
const qsBioBox = '.profileCard__bio'
// Statistics
var liked = 0
var unliked = 0
@bcamargogui
bcamargogui / gist:dd5e263421d886ab84df4de429443167
Created January 14, 2019 10:36
Install Citrix Receiver on Ubuntu 18.04 LTS
Download on https://www.citrix.com/downloads/citrix-receiver/linux/receiver-for-linux-latest.html
If you got a problem seem like this: "Cannot connect 0.0.0.2", try bellow
# cd /opt/Citrix/ICAClient/keystore/
# mv cacerts cacerts.old
# ln -s /etc/ssl/certs cacerts
# /opt/Citrix/ICAClient/util/ctx_rehash
@bcamargogui
bcamargogui / install_oci8_ubuntu_16.04_php7.1.md
Created January 9, 2019 10:57 — forked from hewerthomn/install_oci8_ubuntu_16.04_php7.1.md
How to install OCI8 on Ubuntu 16.04 and PHP 7.1
@bcamargogui
bcamargogui / postman_install.sh
Created September 10, 2018 15:01 — forked from posemon/postman_install.sh
Postman install Ubuntu 18.04
#!/bin/bash
# Get postman app
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
sudo tar -xzf postman.tar.gz -C /opt
sudo ln -s /opt/Postman/Postman /usr/bin/postman
#Create a Desktop Entry
cat > ~/.local/share/applications/postman.desktop <<EOL
[Desktop Entry]
Encoding=UTF-8
<?php
$str_conn="firebird:host=localhost;dbname=/var/lib/firebird/2.5/data/employee.fdb;charset=UTF8";
$dbh = new PDO($str_conn, "sysdba", "masterkey");
?>