Skip to content

Instantly share code, notes, and snippets.

View GiancarloJSantos's full-sized avatar

Giancarlo Santos GiancarloJSantos

View GitHub Profile
@GiancarloJSantos
GiancarloJSantos / gist:b38f2847ac919a85b991594483dea598
Created August 25, 2024 13:31 — forked from levelsio/gist:5bc87fd1b1ffbf4a705047bebd9b4790
Secret of Monkey Island: Amsterdam (by @levelsio) or how to create your own ChatGPT image+text-based adventure game
# 2023-11-27 MIT LICENSE
Here's the open source version of my ChatGPT game MonkeyIslandAmsterdam.com.
It's an unofficial image+text-based adventure game edition of Monkey Island in Amsterdam, my home town.
Please use it however you want. It'd be nice to see more ChatGPT-based games appear from this. If you get inspired by it, please link back to my X https://x.com/levelsio or this Gist so more people can do the same!
Send me your ChatGPT text adventure game on X, I'd love to try it!
@GiancarloJSantos
GiancarloJSantos / spintax.php
Created January 6, 2024 14:39 — forked from irazasyed/spintax.php
PHP: Text Spinner Class - Nested spinning supported.
<?PHP
/**
* Spintax - A helper class to process Spintax strings.
*/
class Spintax
{
/**
* Set seed to make the spinner predictable.
*/

Enable Docker Remote API with TLS client verification

Docker's Remote API can be secured via TLS and client certificate verification.
First of all you need a few certificates and keys:

  • CA certificate
  • Server certificate
  • Server key
  • Client certificate
  • Client key

Create certificate files

@GiancarloJSantos
GiancarloJSantos / README.md
Created November 7, 2021 11:04 — forked from deviantony/README.md
Portainer HTTP API by example

DEPRECATION NOTICE

This gist is now deprecated in favor of our official documentation: https://documentation.portainer.io/api/api-examples/ which contains up to date examples!

THE FOLLOWING DOCUMENTATION IS DEPRECATED

Please refer to the link above to get access to our updated API documentation and examples.

@GiancarloJSantos
GiancarloJSantos / MyClass.php
Created November 4, 2021 13:23 — forked from AndroxxTraxxon/MyClass.php
PHP Generic class constructor
<?php
/**
* The important part here isn't the class structure itself, but the
* __construct(...) function. This __construct is generic enough to be placed into any
* data model class that doesn't preprocess its variables,
*
* Even if you want processing on the variables,
* but simply want an initial value from the get-go,
* you can post-process the values after the if($group){...} statement.
*
@GiancarloJSantos
GiancarloJSantos / API CPF Python
Created April 4, 2019 00:34 — forked from eltondev/API CPF Python
Consulta CPF Detran - Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests,sys,re
dados = {'nome':'','renach':'','cpf':'','dataNascimento':'','local':'','cfc':'','resultado':'', 'data':'','hora':''}
def get_dados(contents): # Regex tags XML
nome = re.search('<nome>(.*)</nome>',contents).group(0).replace('<nome>','').replace('</nome>','')
renach = re.search('<renach>(.*)</renach>',contents).group(0).replace('<renach>','').replace('</renach>','')
@GiancarloJSantos
GiancarloJSantos / array_unique_deep.php
Created March 3, 2019 15:55 — forked from mistic100/array_unique_deep.php
[PHP] Extract unique values of the specified key in a two dimensional array
<?php
/**
* Extract unique values of the specified key in a two dimensional array
*
* @param array $array
* @param mixed $key
* @return array
*/
function array_unique_deep($array, $key)
{
@GiancarloJSantos
GiancarloJSantos / validar_cpf.php
Created January 22, 2019 20:22 — forked from rafael-neri/validar_cpf.php
Validar CPF em PHP (Completo)
<?php
function validaCPF($cpf) {
// Extrai somente os números
$cpf = preg_replace( '/[^0-9]/is', '', $cpf );
// Verifica se foi informado todos os digitos corretamente
if (strlen($cpf) != 11) {
return false;
-> GRID - onRecord
--------------------------------------------------------------------
{wpp} = "<img class='cm_wpp' data-phone='".{telefone}."' data-nome='".{nome}."' data-id='".{id}."' src='/scriptcase9/app/BootstrapTour/_lib/img/grp__NM__ico__NM__if_WhatsApp_1298775.png' border='0'>";
--------------------------------------------------------------------
-> GRID - onScriptInit