Skip to content

Instantly share code, notes, and snippets.

View stefano-rs's full-sized avatar

Stefano stefano-rs

View GitHub Profile
@joseluisq
joseluisq / stream_get_line.md
Last active March 17, 2022 07:09
Comparative between PHP `stream_get_line` and `fgets` about processing large files

Comparative between PHP stream_get_line and fgets about processing large files

Source: http://ie2.php.net/manual/en/function.fgets.php#113113

Regarding Leigh Purdie's comment (from 4 years ago) about stream_get_line being better for large files, I decided to test this in case it was optimized since then and I found out that Leigh's comment is just completely incorrect fgets actually has a small amount of better performance, but the test Leigh did was not set up to produce good results.

The suggested test was:

@stephenhardy
stephenhardy / git-clearHistory
Created April 26, 2013 22:14
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git