Thursday, April 16, 2020

EmailThis for Microsoft Edge is here

I hope this email finds you well, even as we continue to navigate through the uncertainties of COVID-19.

Over the last few weeks, many of us have had to balance work life with increased personal responsibilities. I wanted to reach out to you and reiterate my commitment to developing and improving EmailThis. I am also thrilled to tell you that EmailThis is now available for the Microsoft Edge browser.

EmailThis


Why you should download EmailThis for Edge:

  • One-click save
    Save interesting links and web pages with one click

  • PDF Snapshots
    Send a PDF copy of any web page to your email inbox. This is very useful for taking a print out of any web page or sharing it with your friends.

  • Keyboard Shortcuts
    Save web pages to your email with a nifty keyboard shortcut

  • Right-click and save links
    No need to open web pages, simply right-click on any link that you want to save and choose the 'EmailThis' option.

Head over to the Microsoft Edge store to download EmailThis.


If there's anything else that you'd like to see EmailThis do, please let me know. I'd love to hear your suggestions and comments.


Stay safe in these challenging times.

Sincerely,
Bharani
Founder, EmailThis

Monday, January 13, 2020

Simple PHP CSV Class | Digipiph

Simple PHP CSV Class | Digipiph

EmailThis Premium lets you save unlimited bookmarks, PDF, DOCX files, PPTs and images. It also gives you a PDF copy of every page that you save. Upgrade to Premium →

Throughout my years in programming I've dealt a lot with reading and importing CSV files, exporting queries into CSV files, and building dynamic CSV files. I decided it was time to create a simple PHP class to do all this work for me.

With this class you can change the terminator, separator, enclosed, and escaped characters as well as mime type. You decide the file name and there are simple built in functions to let you easily navigate the rows and columns of the CSV.

The class is compatible with newer AND older (less than 5.3.0) versions of PHP.

Download the PHP CSV Class from Bitbucket here.

Here are some examples of how to use the simple PHP CSV Class.

Reading a CSV File

include('class-CSV.php');   //Start the CSV object and provide a filename $csv = new CSV("testfile"); $csv->readCSV("/home/example/public_html/files/test.csv");   //if the file had a header row you would use //$csv->readCSV("/home/example/public_html/files/test.csv", true);   //access the data $totalRows = $csv->totalRows(); $totalCols = $csv->totalCols(); for($row=0; $row<$totalRows; $row++) {   for($col=0; $col<$totalCols; $col++) {     $value = $csv->getRowCol($row, $col);     echo 'Row: '.$row.' Col: '.$col.' Value: '.$value.'<br />';   }   }

Building and Adding to a CSV Object

include('class-CSV.php');   //Start the CSV object and provide a filename $csv = new CSV("testfile");   //create the header row $headerRow = array("ID", "NAME", "POSITION"); $csv->headerColumns($headerRow);   //add some data $data = array(1, "John Doe", "Sales"); $csv->addRow($data);

Retrieving a Specific Row and Column Value

include('class-CSV.php');   //Start the CSV object and provide a filename $csv = new CSV("testfile");   //create the header row $headerRow = array("ID", "NAME", "POSITION"); $csv->headerColumns($headerRow);   //add some data $data = array(1, "John Doe", "Sales"); $csv->addRow($data); $dataTwo = array(2, "Bobby Bush", "Admin"); $csv->addRow($data);   //show the value of specific row and column echo $csv->getRowCol(0, 1); //outputs "John Doe"   //show the value of specific row and column using header values echo $csv->getRowCol(1, $csv->getHeaderIndex("NAME")); //outputs "Bobby Bush"

Exporting a CSV File

include('class-CSV.php');   //Start the CSV object and provide a filename $csv = new CSV("testfile");   //create the header row $headerRow = array("ID", "NAME", "POSITION"); $csv->headerColumns($headerRow);   //add some data $data = array(1, "John Doe", "Sales"); $csv->addRow($data); $dataTwo = array(2, "Bobby Bush", "Admin"); $csv->addRow($data);   //export the data to a CSV file $csv->export();

Source: https://digipiph.com/blog/simple-php-csv-class

Upgrade to Premium Plan

✔ Save unlimited bookmarks.

✔ Save PDFs, DOCX files, images and Excel sheets as email attachments.

✔ Get priority support and access to latest features.

Upgrade to Premium

Wednesday, December 04, 2019

Remove tracking branches no longer on remote

Remove tracking branches no longer on remote

EmailThis Premium lets you save unlimited bookmarks, PDF, DOCX files, PPTs and images. It also gives you a PDF copy of every page that you save. Upgrade to Premium →

I wouldn't normally answer a question that already has 16 answers, but all the other answers are wrong, and the right answer is so simple. The question says, "Is there a simple way to delete all tracking branches whose remote equivalent no longer exists?"

If "simple" means deleting them all in one go, not fragile, not dangerous, and without reliance on tools that not all readers will have, then the right answer is: no.

Some answers are simple, but they don't do what was asked. Others do what was asked, but are not simple: all rely on parsing Git output through text-manipulation commands or scripting languages, which may not be present on every system. On top of that, most of the suggestions use porcelain commands, whose output is not designed to be parsed by script ("porcelain" refers to the commands intended for human operation; scripts should use the lower-level "plumbing" commands).

Further reading:


If you want to do this safely, for the use case in the question (garbage-collect tracking branches which have been deleted on the server but still exist as local branches) and with high-level Git commands only, you have to

  • git fetch --prune (or git fetch -p, which is an alias, or git prune remote origin which does the same thing without fetching, and is probably not what you want most of the time).
  • Note any remote branches that are reported as deleted. Or, to find them later on, git branch -v (any orphaned tracking branch will be marked "[gone]").
  • git branch -d [branch_name] on each orphaned tracking branch

(which is what some of the other answers propose).

If you want to script a solution, then for-each-ref is your starting point, as in Mark Longair's answer here and this answer to another question, but I can't see a way to exploit it without writing a shell script loop, or using xargs or something.


Background explanation

To understand what's happening, you need to appreciate that, in the situation of tracking branches, you have not one branch, but three. (And recall that "branch" means simply a pointer to a commit.)

Given a tracking branch feature/X, the remote repository (server) will have this branch and call it feature/X. Your local repository has a branch remotes/origin/feature/X which means, "This is what the remote told me its feature/X branch was, last time we talked," and finally, the local repository has a branch feature/X which points to your latest commit, and is configured to "track" remotes/origin/feature/X, meaning that you can pull and push to keep them aligned.

At some point, someone has deleted the feature/X on the remote. From that moment, you are left with your local feature/X (which you probably don't want any more, since work on feature X is presumably finished), and your remotes/origin/feature/X which is certainly useless because its only purpose was to remember the state of the server's branch.

And Git will let you automatically clean up the redundant remotes/origin/feature/X -- that's what git fetch --prune does -- but for some reason, it doesn't let you automatically delete your own feature/X... even though your feature/X still contains the orphaned tracking information, so it has the information to identify former tracking branches that have been fully merged. (After all, it can give you the information that lets you do the operation by hand yourself.)

Source: https://stackoverflow.com/questions/7726949/remove-tracking-branches-no-longer-on-remote

Please check the attached file.

EmailThis was not able to extract useful content from the website. Hence, we have saved the webpage to a PDF file. You can find that attached along with this email.

Upgrade to Premium Plan

✔ Save unlimited bookmarks.

✔ Save PDFs, DOCX files, images and Excel sheets as email attachments.

✔ Get priority support and access to latest features.

Upgrade to Premium