Skip to content

Instantly share code, notes, and snippets.

@paulgregg
paulgregg / ANSI.md
Created October 18, 2024 12:08 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@paulgregg
paulgregg / README.md
Last active April 22, 2025 03:02
Converting a gitlab export to simple git repo

Converting a gitlab export to simple git repo

Gitlab exports a tar.gz file which contains a file called project.bundle. We can convert this file into a normal git repo using the following steps:

Extract the project.bundle file

$ tar xvfz GitLabExport.gz
@paulgregg
paulgregg / dirsunique.pl
Created October 26, 2014 13:15
Extract unique subdirectories from a file, ignoring parent dirs
#!/usr/bin/perl
# [email protected]
use Data::Dumper;
my $d={};
while(<STDIN>) {
chomp;
next if(/^$/);
@bits = split(/\//, $_);
$last = pop(@bits);
$dr = $d;