Skip to content

Instantly share code, notes, and snippets.

@ttribeiro
ttribeiro / 1-head-tracking-code.html
Created January 14, 2025 03:51 — forked from cliffordp/1-head-tracking-code.html
Get image file IDs from GoHighLevel Media Storage list view and display them in a sexy, smooth, cross-browser FsLightbox
<style id="fslightbox-customizations">
a.open-gallery > img {
width: 80%;
max-width: 745px;
border: 3px dashed white;
}
.fslightbox-container {
background: black;
}
</style>
@ttribeiro
ttribeiro / postfix_mail_macosx.md
Created September 16, 2024 11:59 — forked from haccks/postfix_mail_macosx.md
Send mail from local host using postfix on MacOS High Sierra.

Setting up postfix on MacOS High Sierra

MacOS Sierra High comes with preinstalled postfix. Follow these steps to configure it on a local system:

1. Create a sasl_passwd file

sudo nano /etc/postfix/sasl_passwd
  • Add this to the file
@ttribeiro
ttribeiro / postfix_mail_macosx.md
Created September 16, 2024 11:59 — forked from haccks/postfix_mail_macosx.md
Send mail from local host using postfix on MacOS High Sierra.

Setting up postfix on MacOS High Sierra

MacOS Sierra High comes with preinstalled postfix. Follow these steps to configure it on a local system:

1. Create a sasl_passwd file

sudo nano /etc/postfix/sasl_passwd
  • Add this to the file
#!/usr/bin/env bash
CIPHERS='ALL:eNULL'
DELAY=${2:-0.1}
SERVER=${1:?usage: $0 <host:port> [delay, default is ${DELAY}s] [ciphers, default is ${CIPHERS}]}
MAXLEN=$(openssl ciphers "$CIPHERS" | sed -e 's/:/\n/g' | awk '{ if ( length > L ) { L=length} }END{ print L}')
echo Using $(openssl version).
declare -A TLSMAP=( [tls1_1]=cipher [tls1_2]=cipher [tls1_3]=ciphersuites )
@ttribeiro
ttribeiro / destiny2_api_intro.py
Created November 16, 2022 17:33 — forked from cortical-iv/destiny2_api_intro.py
Highly annotated introduction to the destiny2 api (Python)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Getting Started using the Destiny 2 Api
An annotated guide to some of the public endpoints available for examining a user's
characters, items, and clan using the Destiny 2 API. You will need to use your api key for
this to work. Just insert it as a string where it says <my_api_key> in the beginning.
It is broken into four parts:
0: Imports, variables, and fixed parameters defined
@ttribeiro
ttribeiro / nginx.conf
Created November 12, 2018 17:39 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
<?php
class DeivisonArthur_OnepageCheckout_Model_Service_Quote extends Mage_Sales_Model_Service_Quote
{
protected function _validate()
{
$helper = Mage::helper('sales');
if (!$this->getQuote()->isVirtual())
{
$address = $this->getQuote()->getShippingAddress();
$addrValidator = Mage::getSingleton('onepagecheckout/type_geo')->validateAddress($address);
<?php if (!strcmp ($cc_type, 'BOL_ITAU') || !strcmp ($cc_type, 'TEF_ITAU')): ?>
<form id="print-billet-form" method="get" target="_blank" action="https://shopline.itau.com.br/shopline/shopline.asp">
<?php
$sql = " SELECT acquirer_transaction_id FROM payment_return WHERE order_id = " . $_order->getId ();
$resource = Mage::getSingleton ('core/resource');
$connection = $resource->getConnection ('core_read');
$store = $connection->query ($sql);
$children = $store->fetchAll (PDO::FETCH_ASSOC);
?>
<input type="hidden" name="DC" value="?DC=<?=$children[0]['acquirer_transaction_id'];?>" />
<?php
/*
Objetivo criar uma chave serial para cada dominio. O script pega a chave gerada e compara com o $_SERVER['HTTP_HOST']
*/
//link do demo do gen: http://onestepcheckout.com.br/LojaModelo/keygen/
//linha para ser add nas paginas que serao bloqueadas
@ttribeiro
ttribeiro / inspect_cpus.js
Created September 2, 2012 04:26 — forked from marcosbrasil/inspect_cpus.js
Inspect CPU usage with nodejs os.cpus() module
var os = require("os");
var exec = require('child_process').exec;
function sysLog(){
//exec('clear', sysLog);
var cpus = os.cpus();
for(var i = 0, len = cpus.length; i < len; i++) {
var cpu = cpus[i], total = 0, processTotal = 0, strPercent = '';