Skip to content

Instantly share code, notes, and snippets.

View marceloneppel's full-sized avatar

Marcelo Henrique Neppel marceloneppel

View GitHub Profile
@EastonLee
EastonLee / code_probe.py
Last active September 20, 2023 13:32
utility that can print context source code on any frame of stack and variables you care against Python inspect
collective_code_location_message = '\n'
def print_dict(dict, verbose=True):
#callerframerecord = inspect.stack()[1] # 0 represents this line
# # 1 represents line at caller
#frame = callerframerecord[0]
#info = inspect.getframeinfo(frame)
#if info.function == 'print_sql_result':
# code_probe('',2)
#else:
# code_probe('', 1)
@bumaociyuan
bumaociyuan / jxaClickAppSubMenuItem.applescript
Last active May 11, 2024 18:29 — forked from RobTrew/jxaClickAppSubMenuItem.applescript
Yosemite JXA Javascript Function for clicking application sub-menu items
// Click an OS X app sub-menu item
// 2nd argument is an array of arbitrary length (exact menu item labels, giving full path)
// e.g. menuItemClick("InqScribe", ['View', 'Aspect Ratio', 'Use Media Ratio'])
// Note that the menu path (spelling & sequence) must be exactly as in the app
// See menuItemTestClick() below for a slower version which reports any errors
// For OS X 10.10 Yosemite JXA JavaScript for Automation
@leonardofed
leonardofed / README.md
Last active November 14, 2024 13:37
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@davidalves1
davidalves1 / formatar_cnpj_cpf.md
Last active October 22, 2024 14:21
Função para formatar CNPJ e CPF, disponível em PHP e JS

PHP

function formatCnpjCpf($value)
{
  $CPF_LENGTH = 11;
  $cnpj_cpf = preg_replace("/\D/", '', $value);
  
  if (strlen($cnpj_cpf) === $CPF_LENGTH) {
    return preg_replace("/(\d{3})(\d{3})(\d{3})(\d{2})/", "\$1.\$2.\$3-\$4", $cnpj_cpf);
  } 
@Zulko
Zulko / python_mermaid_class_tree.py
Created April 18, 2017 18:04
Automatic Python module class tree generation, using Mermaid for rendering
import inspect
def class_name(cls):
"""Return a string representing the class"""
# NOTE: can be changed to str(class) for more complete class info
return cls.__name__
def classes_tree(module, base_module=None):
if base_module is None:
base_module == module.__name__
@skippednote
skippednote / setup-tor.md
Last active September 16, 2024 12:29
Setup Tor on macOS

Setup One: Buy a Mac if you don't have one.

Setup Two: Install Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Setup Three:

@bmcculley
bmcculley / dummy-web-server.py
Last active November 17, 2022 04:02 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python (2/3). Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
@jaircuevajunior
jaircuevajunior / compile_mysql.md
Last active April 7, 2024 12:42
Compile MySQL 5.7 from source
  1. Download build-tools
apt-get install build-essential cmake -y
  1. Configure the compiler
cmake \
-DWITH_BOOST=/usr/local/src/mysql-5.7.19/boost/boost_1_59_0 \
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql57 \
@calebmadrigal
calebmadrigal / rewrite_strings.py
Created August 24, 2017 20:29
Example of changing the python AST
import ast
class StringWrapper(ast.NodeTransformer):
"""Wraps all strings in 'START ' + string + ' END'. """
def visit_Str(self, node):
return ast.Call(func=ast.Name(id='wrap_string', ctx=ast.Load()),
args=[node], keywords=[])
def wrap_string(s):
return 'START ' + s + ' END'
@anjesh
anjesh / readme.md
Created August 27, 2017 03:41
mysql source compiling
  • Download mysql source

  • Ran the following cmake command based on the documentation

cmake \
  -DCMAKE_INSTALL_PREFIX=/usr/local/mac-dev-env/mysql-5.7.18 \
  -DCMAKE_CXX_FLAGS="-stdlib=libstdc++" \
  -DDEFAULT_CHARSET=utf8 \
  -DDEFAULT_COLLATION=utf8_general_ci \