App-Cheats
view release on metacpan or search on metacpan
#############################################################
## Bash - Ascii Art
#############################################################
# Ascii Art
figlet "svn update"
# Nice format for representing binary numbers (art,ascii)
figlet "0000011111" -f digital
# Show all available figlest fonts (ascii art)
figlist | perl -lne '$a=/\bfonts.*:$/ ... /.*:/; print if $a > 1 and $a !~ /E/'
# There are the nicer fonts
banner big lean slant smslant standard
# favorite
slant
figlet "svn update" -f slant
# Center the ascii art (justify)
figlet "svn update" -f slant -c
# Right justify the ascii art and set a width of 60
figlet "svn update" -f slant -r -w 60
# }
#
# });
# }
# JQuery Tooltip CSS
#/* ------------------- Tooltip ------------------------- */
#.ui-tooltip {
# padding: 10px 20px;
# border-radius: 20px;
# font: bold 14px"Helvetica Neue", Sans-Serif;
# box-shadow: 0 0 7px black;
# background-color: white;
# width: fit-content;
# position: absolute;
#}
#
#/* Prevent seeing content appended to the body */
#.ui-helper-hidden-accessible {
# display: none;
#}
#
#.table .cell.clicked_tooltip {
# color: #06a003;
# font-weight: 600;
#}
#############################################################
## JQuery - Variables
#############################################################
# Store jquery variables inside html elements
# Using data() preserves the type of the variable.
# Using attr() simply converts the variable to a string.
perl -MTk -le '$mw=MainWindow->new; my @b; sub id{my($n)=grep{$b[$_] eq $_[0]}0..$#b; $n} for(1..3){push @b, $mw->Button(-text => "B$_", -width => 20)->pack} $mw->bind("<ButtonRelease-1>",[sub{$m=id(shift); $n=id($mw->containing(@_)); @b[$m,$n]=@b[$n...
# Swap frames of buttons (PTk)
perl -MTk -le '$mw=MainWindow->new; my @b; sub id{my($n)=grep{$b[$_] eq $_[0]}0..$#b; $n} for my $fi(1..3){my $f=$mw->Frame->pack; push @b,$f; $f->Button(-text => "Btn - $fi - $_", -width => 20)->pack(-side => "left") for 1..3} $mw->bind("<ButtonRele...
# Notebook example 1. multiple pages/tabs (PTk)
perl -MTk -MTk::NoteBook -le '$nb=MainWindow->new->NoteBook->pack(-fill => "both", -expand => 1); @pgs = map { $nb->add("page$_", -label => "Page $_") } 0..5; $pgs[0]->Button(-text => "Button $_")->pack(-fill => "both") for 1..5; $pgs[1]->Label(-text...
# Notebook example 2. multiple pages/tabs (PTk)
# Command when clicking a page/tab
perl -MTk -MTk::NoteBook -le '$nb=MainWindow->new->NoteBook(-font => "Courier 14 bold")->pack(-fill => "both", -expand => 1); @pgs = map { $nb->add("page$_", -label => "Page $_") } 0..20; $pgs[0]->Button(-text => "Button $_")->pack(-fill => "both") f...
# Notebook example 3. multiple pages/tabs (PTk)
# Page deletion
perl -MTk -MTk::NoteBook -le '$nb=MainWindow->new->NoteBook->pack(-fill => "both", -expand => 1); @pgs = map { $nb->add("page$_", -label => "Page $_") } 0..10; $nb->pagecget("page0", "-state"); $pgs[0]->Button(-text => "Button $_")->pack(-fill => "bo...
# Notebook example 4. multiple pages/tabs (PTk)
# Get page by name
perl -MTk -MTk::NoteBook -le '$nb=MainWindow->new->NoteBook->pack(-fill => "both", -expand => 1); @pgs = map { $nb->add("page$_", -label => "Page $_") } 0..10; $nb->pagecget("page0", "-state"); $pgs[0]->Button(-text => "Button $_")->pack(-fill => "bo...
# Notebook example 5. multiple pages/tabs (PTk)
perl -MTk -le '$w=tkinit; $c=$w->Canvas->pack; $c->createLine(20,20,200,200,200,20); $b=$w->Button(-text => "Save", -command => sub{$c->postscript(-file => "tk.ps")})->pack; MainLoop'
ps2pdf tk.ps tk.pdf
xpdf tk.pdf
#############################################################
## Perl Modules - Tk (Tags)
#############################################################
# Text tags example (PTk)
perl -MTk -le '$t=tkinit->Text->pack; $t->tagConfigure("bold", -font => "Courier 24 bold"); $t->insert("end", "Normal Text\n"); $t->insert("end", "Bold Text\n", "bold"); MainLoop'
# Make select text bold (PTk)
perl -MTk -le '$w=tkinit; $t=$w->Text->pack; $t->tagConfigure("bold", -font => "bold"); $t->insert("end", "A Bunch of text"); $w->Button(-text => "BOLD", -command => sub{$t->tagAdd("bold", "sel.first", "sel.last")} )->pack; MainLoop'
# Check if a selection exists (PTk)
perl -MTk -le '$w=tkinit; $t=$w->Text->pack; $t->tagConfigure("bold", -font => "bold"); $t->insert("end", "A Bunch of text"); $w->Button(-text => "BOLD", -command => sub{$t->tagAdd("bold", "sel.first", "sel.last") if $t->tagRanges("sel")} )->pack; Ma...
#############################################################
## Perl Modules - Tk (Appendix B)
#############################################################
# Adjuster example (PTk,Appendix B)
perl -MTk -le '$w=tkinit; %def=qw/-fill both -expand 1/; $b=$w->Button(-text => "Button A")->pack(%def); $w->Adjuster(-side => "top", -widget => $b)->pack(qw/-fill x/); $w->Button(-text => "Button B")->pack(%def); MainLoop'
# Balloon Example (Ptk,Appendix B)
# Need to have this setup one time (as admin)
openfiles.exe /local on
# restart PC
#############################################################
## Windows - Outlook
#############################################################
# Windows Outlook.
# Monospaced font
Courier New
#############################################################
## Windows - Registry
#############################################################
# Registry file location on windows 10
C:\Users\<USER>\NTUSER.DAT
( run in 1.223 second using v1.01-cache-2.11-cpan-5735350b133 )