App-Cheats

 view release on metacpan or  search on metacpan

cheats.txt  view on Meta::CPAN

RED='\033[00;31m'
GREEN='\033[00;32m'
YELLOW='\033[00;33m'
VIOLET='\033[00;35m'
TEAL='\033[00;36m'
GREY='\033[00;37m'

# View color ansi escapes with less (like Vim)
less -R file

# Make xterm text color bold
BOLD='\033[1m'

# Make xterm text color blink
BLINK='\033[5m'

# Move mouse to a specific location on the screen/xterm window (on lnxbr42)
xdotool mousemove 764 11

# Click on a button (cannot on top bar , like the X for close)
xdotool click 1

cheats.txt  view on Meta::CPAN

#			}
#
#		});
#	}

# 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;
#}

cheats.txt  view on Meta::CPAN

## Perl Modules - Excel::Writer::XLSX
#############################################################

# Excel - Simple: Generate a blank xlsx file
perl -MExcel::Writer::XLSX -E "$wb = Excel::Writer::XLSX->new('my.xlsx'); $wb->close"

# Excel - Simple: Check for errors openning an excel file and write to a cell
# Also rename the worksheet
perl -MExcel::Writer::XLSX -E "$wb = Excel::Writer::XLSX->new('my.xlsx') or die qq($!\n); $ws = $wb->add_worksheet('my'); $ws->write('A1', 'Hello Excel'); $wb->close"

# Excel - Simple: Add a format to make a cell bold
perl -MExcel::Writer::XLSX -E "$wb = Excel::Writer::XLSX->new('my.xlsx') or die qq($!\n); $ws = $wb->add_worksheet('my'); $format = $wb->add_format; $format->set_bold; $ws->write(0, 0, 'Hello Excel', $format); $wb->close"

# Create a spreadsheet/excel with formulas using perl (only on lnxbr42)
perl -MExcel::Writer::XLSX -le '
   $wb=Excel::Writer::XLSX->new("new.xlsx");
   $ws=$wb->add_worksheet;
   $ws->write("A1","In Excel");
   $ws->write("B2",3);
   $ws->write("B3",4);
   $ws->write("B4","=B2+B3");
   $ws->write("B5","=SUM(B2:B4)");

cheats.txt  view on Meta::CPAN

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)

cheats.txt  view on Meta::CPAN

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)

cheats.txt  view on Meta::CPAN


# Name of file that is opened in vim
let _curfile = expand("%:t")

# Show line numbers in vim (vimrc)
set number

# Vim resource (vimrc) file. other features.
set nowrap
set cursorline
hi CursorLine term=bold cterm=bold guibg=Grey40
set cursorcolumn

# Do not go past the end of the file when searching (Vim)
set nowrapscan

# View the current file type of a Vim file
:set filetype?

# Check the file type (Vim,xterm,shell)
file ~/bin/enter_ui.sh



( run in 0.732 second using v1.01-cache-2.11-cpan-5dc5da66d9d )