Skip to content

Instantly share code, notes, and snippets.

View tabacitu's full-sized avatar

Cristian Tăbăcitu tabacitu

View GitHub Profile
@mwisner
mwisner / vapor.yml
Created October 16, 2019 17:24
Laravel Backpack Vapor Guide
build:
- 'composer install --no-dev --classmap-authoritative'
- 'php artisan event:cache'
- 'sh ../../../utils/vapor_build_purge.sh'
@breizhwave
breizhwave / listSum.blade.php
Last active January 11, 2021 15:34
add sum in list blade
<script>
// Insert the sum of a column into the columns footer, for the visible
// data on each draw
// var table = $('#crudTable').DataTable();
// $("#wave_total").html( $('#crudTable').column( 3 ).data().sum());
jQuery(document).ready(function($) {
jQuery.fn.dataTable.Api.register( 'sum()', function ( ) {
return this.flatten().reduce( function ( a, b ) {
if ( typeof a === 'string' ) {
a = a.replace(/[^\d.-]/g, '') * 1;
@calebporzio
calebporzio / PreviewOfUpcomingPackage.php
Last active April 16, 2024 06:26
A model trait that allows child models to use parent table names and relationship keys.
<?php
namespace App\Abilities;
use Illuminate\Support\Str;
use ReflectionClass;
/**
* Note: This is a preview of an upcoming package from Tighten.
**/
@unfulvio
unfulvio / vagrant_setdate.sh
Last active June 30, 2022 16:33
How to change server time on a Vagrant box on Virtualbox
#!/bin/bash
# Log in into the box
vagrant ssh
# VirtualBox syncs host time with guest, so we need to shut off VBox Guest Additions first
sudo service vboxadd-service stop
# Now you can set any date and time
sudo date -s "2020-10-01 10:25:00"
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active April 30, 2024 23:36
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@barryvdh
barryvdh / _ide_helper.php
Last active April 4, 2024 09:11
Laravel IDE Helper for Netbeans / PhpStorm / Sublime Text 2 CodeIntel, generated using https://github.com/barryvdh/laravel-ide-helper
<?php
/**
* A helper file for Laravel 5, to provide autocomplete information to your IDE
* Generated for Laravel 5.5.13 on 2017-09-28.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
exit("This file should not be included, only analyzed by your IDE");