Skip to content

Instantly share code, notes, and snippets.

View drew887's full-sized avatar
🇺🇦

Andrew Mcdonald Притула drew887

🇺🇦
View GitHub Profile
@drew887
drew887 / str_putcsv.php
Last active March 29, 2018 02:59
My str_putcsv implementation, probably could be better but behaves the same as fputcsv, except it always wraps with ""
<?php
/**
* Takes an array and returns a string of csv in the same format that fputcsv
* would; but every one is wrapped rather than just ones that require it
* because str_getcsv will still parse itcorrectly
*
* NOTE: That currently str_getcsv and fgetcsv fail with encaser being any
* value other than " this holds for if its encoded with fputcsv as well.
*
* @param array $fields an array of string values to encode in csv
@drew887
drew887 / .gitconfig
Last active December 22, 2021 19:39
Just the common parts of my gitconfig so I can copy them to a new machine
[alias]
tr = log --oneline --graph --decorate
trf = log --oneline --graph --decorate --first-parent
trs = log --oneline --graph --decorate --show-signature
tra = log --oneline --graph --all --decorate
traf = log --oneline --graph --all --decorate --first-parent
tras = log --oneline --graph --all --decorate --show-signature
br = branch
brr = branch -r
st = status