Skip to content

Instantly share code, notes, and snippets.

View bramburn's full-sized avatar
🩰
Working on some Angular packages...sadly not on github....

Bhavesh Ramburn bramburn

🩰
Working on some Angular packages...sadly not on github....
View GitHub Profile
@bramburn
bramburn / gist:05857e84d4827ceef4bb
Created February 27, 2016 22:16
Laravel + Carbon difference between two dateTime column
public function DurationOfTimesheet($timesheet_id, $output = null) {
$time = $this->where('id', $timesheet_id)->first();
if (empty($time)) {
return "timesheet not found";
} else {
// dd($time->start);
$start = Carbon::createFromFormat('Y-m-d H:i:s', $time->start);
@virolea
virolea / upload.js
Last active July 9, 2024 02:29
Tracking file upload progress using axios
upload(files) {
const config = {
onUploadProgress: function(progressEvent) {
var percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
console.log(percentCompleted)
}
}
let data = new FormData()
data.append('file', files[0])