Skip to content

Instantly share code, notes, and snippets.

@hlucasfranca
hlucasfranca / git-compressing-and-deltas.md
Created September 8, 2024 22:14 — forked from matthewmccullough/git-compressing-and-deltas.md
Git, Compression, and Deltas - An explanation

Git Compression of Blobs and Packfiles.

Many users of Git are curious about the lack of delta compression at the object (blob) level when commits are first written. This efficiency is saved until the pack file is written. Loose objects are written in compressed, but non-delta format at the time of each commit.

A simple run though of a commit sequence with only the smallest change to the image (in uncompressed TIFF format to amplify the observable behavior) aids the understanding of this deferred and different approach efficiency.

The command sequence:

Create the repo:

@hlucasfranca
hlucasfranca / difference.js
Created April 6, 2023 12:16 — forked from Yimiprod/difference.js
Deep diff between two object, using lodash
/**
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
return _.transform(object, function(result, value, key) {
if (!_.isEqual(value, base[key])) {
@hlucasfranca
hlucasfranca / Udemy_RemainingTime_Finder.js
Created December 4, 2022 00:42 — forked from jithurjacob/Udemy_RemainingTime_Finder.js
Script to find Udemy Course remaining time
//credits - https://greasyfork.org/en/scripts/28295-udemy-show-section-time
// greasyfonrk was throwing me an error so I created this gist
(function() {
$.getScript("https://greasyfork.org/scripts/5392-waitforkeyelements/code/WaitForKeyElements.js?version=115012", function(){
// waits for the cards to be loaded
waitForKeyElements(selectors.sectionCard, run, true);
});
var selectors = {
sectionCard: 'curriculum-navigation-section',

Here are several different ways to test a TCP port without telnet.

$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C

$ cat &lt; /dev/tcp/127.0.0.1/23
from bs4 import BeautifulSoup
attributes = [
"camunda:class",
"camunda:topic",
"camunda:type"
]
with open('process.bpmn', 'r') as f:
@hlucasfranca
hlucasfranca / README.md
Created May 9, 2022 15:43 — forked from IanVaughan/README.md
Push branch from one remote into another
#-------------------------------------------------------------------------
# FROM: https://kind.sigs.k8s.io/docs/user/local-registry/
set -o errexit
# create registry container unless it already exists
reg_name='kind-registry'
reg_port='5001'
if [ "$(docker inspect -f '{{.State.Running}}' "${reg_name}" 2>/dev/null || true)" != 'true' ]; then
docker run \
@hlucasfranca
hlucasfranca / gist:56b20951825971a650e7369b874185c2
Created March 2, 2022 19:12 — forked from rkbalgi/gist:183a113e946dd9f8360e774dcf17a3db
JDBC_PING with keycloak and postgresql on AWS Fargate
In your effort of implementing standalone-ha with keycloak postgresql using JDBC_PING you will stumble upon many sites that define
the table structure for jgroupsping and the right one goes like this -
CREATE TABLE IF NOT EXISTS JGROUPSPING (
own_addr varchar(200) NOT NULL,
cluster_name varchar(200) NOT NULL,
ping_data BYTEA,
constraint PK_JGROUPSPING PRIMARY KEY (own_addr, cluster_name)
);
@hlucasfranca
hlucasfranca / standalone.xml
Created October 26, 2021 23:33 — forked from skvithalani/standalone.xml
JBoss wildfly, keycloak logs in json format, along with reading the log file location from environment variable
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns="urn:jboss:domain:9.0">
<extensions>
<extension module="org.jboss.as.clustering.infinispan"/>
<extension module="org.jboss.as.connector"/>
<extension module="org.jboss.as.deployment-scanner"/>
<extension module="org.jboss.as.ee"/>
<extension module="org.jboss.as.ejb3"/>
<extension module="org.jboss.as.jaxrs"/>
@hlucasfranca
hlucasfranca / gist:6697ec31f43b9b1b80a0281a136a6b6a
Last active August 20, 2020 07:05 — forked from jdye64/gist:ca07e01ff3d8e93210c3
Convert .dav files in current directory to .mp4
#!/usr/bin/python
print "Converting all of the .dav files in this current directory into .mp4 files using ffmpeg"
import os
from subprocess import call
files = [f for f in os.listdir('.') if os.path.isfile(f)]
for f in files:
ext = f.split(".")[-1]
if ext == "dav" or ext == "DAV":