terminalforlife / perlprojects Goto Github PK
View Code? Open in Web Editor NEWVarious Perl projects and smaller Perl scripts.
License: GNU General Public License v3.0
Various Perl projects and smaller Perl scripts.
License: GNU General Public License v3.0
This is perl 5, version 34, subversion 0 (v5.34.0) built for x86_64-linux-thread-multi
code in file
#------------------------------------------------------------------------------
# Path - /usr/bin/editbash
# GitHub - https://github.com/The-Repo-Club/
# Author - The-Repo-Club [[email protected]]
# Start On - Sat 30 Oct 15:00:06 BST 2021
# Modified On - Sun 31 Oct 01:01:56 BST 2021
#------------------------------------------------------------------------------
code im using
#!/usr/bin/env perl
#cito M:755 O:0 G:0 T:/usr/bin/dayborn
#------------------------------------------------------------------------------
# Project Name - PerlProjects/source/dayborn
# Started On - Mon 10 Feb 23:49:15 GMT 2020
# Last Change - Mon 1 Feb 01:44:26 GMT 2021
# Author E-Mail - [email protected]
# Author GitHub - https://github.com/terminalforlife
#------------------------------------------------------------------------------
# This project was originally called Iteration. The aim was to generate a more
# traditional version number from the delta of the two timestamps, the time the
# project was born, and the time of the last change made.
#
# In the end, it wound up being a nifty little program which simply outputs how
# many days it has been since the project was born, hence the name.
#
# Dependencies:
#
# perl (>= 5.22.1-9)
#------------------------------------------------------------------------------
require Date::Format;
require Time::Piece;
use v5.22.1;
use strict;
use warnings;
use autodie;
use Date::Format 'time2str';
use Time::Piece;
no warnings 'uninitialized';
my $CurVer = '2021-02-01';
my $Progrm = 'dayborn';
sub Usage{
print(qq{Usage: $Progrm [OPTS] [FILE]
-h, --help - Display this help information.
-v, --version - Output the version datestamp.
} =~ tr/\t//dr)
}
while (defined($ARGV[0])){
if ($ARGV[0] =~ '^(--help|-h|-\?)$'){
Usage(1); exit(0)
}elsif ($ARGV[0] =~ '^(--version|-v)$'){
print("$CurVer\n"); exit(0)
}elsif ($ARGV[0] =~ '^-'){
die("Incorrect option(s) specified")
}else{
last
}
shift()
}
scalar(@ARGV) == 1 or die("File name required");
scalar(@ARGV) > 1 and die("Only one file at a time is valid");
-f $ARGV[0] or die("File '$ARGV[0]' not found");
-r $ARGV[0] or die("File '$ARGV[0]' unreadable");
-B $ARGV[0] and die("File '$ARGV[0]' is binary");
open(my $FH, '<', $ARGV[0]);
my ($Start, $Now);
while (<$FH>){
/^# (Started|Modified) / or next;
chomp(my @Arr = split(' '));
# The following format (sans quotes) is expected:
#
# '# Started On - Mon 10 Feb 23:49:15 GMT 2020'
#
if ($Arr[1] eq 'Started') {
$Start = Time::Piece->strptime(
join(' ', @Arr[4,6,5,7,9]), '%a %b %d %T %Z %Y'
)->epoch()
}
# The following format (sans quotes) is expected:
#
# '# Modified On - Tue 11 Feb 01:00:34 GMT 2020'
#
if ($Arr[1] eq 'Modified') {
$Now = Time::Piece->strptime(
join(' ', @Arr[4,6,5,7,9]), '%a %b %d %T %Z %Y'
)->epoch()
}
}
close($FH);
my $Project = ($ARGV[0] =~ m{(?:.*/)?([^/].*)})[0];
my $DeltaDay = ($Now - $Start) / 60 / 60 / 24;
printf("Project '%s' was born %.2f day's ago.\n", $Project, $DeltaDay)
output i get
Project 'editbash' was born 18931.04 day's ago.
Sorry, I keep forgetting to fix that damn Bash completion script. Here's a quick fix if you've already got it installed, either via the Deb package or using something like Cito:
sudo sed -i 's/rmne/ubuchk/g' /usr/share/bash-completion/completions/ubuchk
It of course assumes the default location, and that you have sudo(8) installed. You may have to restart your shell session in order for it to be re-read.
The completion is a bit buggy anyway. I thought I'd fixed it, but I must have overwritten the changes I made on my laptop, by mistake. Hopefully in the next update we'll finally have it working properly.
i cant found TFL
i try cpan TFL and many ways but i cant install it
some help will be great
Hi TFL
So I started watching some video this weekend and love your contents. Started to looking at your code to learn more but all of your videos are gone?. Hope all is ok, have you moved to a new platform? Your stuff is really great and appreciate the content and comments of your knowledge. Again hope all is well with you. Wish you had a way to be contacted
Sorry but I couldn't find any other platform to reach you, I was trying to loof for your vids (adventOfCode in shell) and couldn't find em, turns out your channel disappeared from yt? Would appreciate any update
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.