Skip to content

Instantly share code, notes, and snippets.

View jeffersoncandidozup's full-sized avatar
🎯
Focusing

Jefferson da Silva Cândido jeffersoncandidozup

🎯
Focusing
View GitHub Profile
@rponte
rponte / get-latest-tag-on-git.sh
Last active February 2, 2026 14:38
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples
@pypt
pypt / pyyaml-duplicates.py
Created September 9, 2015 22:10
PyYAML: raise exception on duplicate keys on the same document hierarchy level
import yaml
from yaml.constructor import ConstructorError
try:
from yaml import CLoader as Loader
except ImportError:
from yaml import Loader
def no_duplicates_constructor(loader, node, deep=False):
@igrep
igrep / gist:1028628
Created June 16, 2011 03:37
(UNNAMED) generator expression like Python in Ruby
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
$VERBOSE = true
=begin
Maybe usable as generator expression in Python
requires ruby1.9 or facets ( >= 2.9.1 )
=end
if RUBY_VERSION < '1.9'
require 'rubygems'