Skip to content

Instantly share code, notes, and snippets.

Did I hear you wanted AJAX charts instead of hard coded? You got it.

Follow this guide to integrate bar chart reports into your Laravel application with AJAX. Reports like the following come with this guide:

  • Total number of Orders by day
  • Total number of Users subscribed by day
  • etc

The library used for the charts is: http://www.oesmith.co.uk/morris.js/

@tofbabs
tofbabs / iconv.docker
Created May 28, 2018 09:03 — forked from tristanlins/iconv.docker
Docker PHP extension recipes
FROM php:5.6-cli
RUN apt-get update \
&& apt-get install -y \
libfreetype6-dev \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-install iconv \
&& apt-get remove -y \
libfreetype6-dev \
&& apt-get install -y \
@tofbabs
tofbabs / deletebyquery.sh
Created May 28, 2018 09:04 — forked from dadoonet/deletebyquery.sh
Delete By Query usage
echo "clean index"
curl -XDELETE 'http://localhost:9200/twitter?pretty' ; echo
echo "PUT Tweet"
curl -XPUT 'http://localhost:9200/twitter/tweet/1?ttl=1h&pretty' -d '
{
"created_at": "Mon May 13 19:59:27 +0000 2013"
}
' ; echo
@tofbabs
tofbabs / .htaccess
Created June 29, 2018 13:43 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@tofbabs
tofbabs / delete_git_submodule.md
Created January 20, 2019 17:13 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@tofbabs
tofbabs / README.md
Created February 27, 2020 14:16 — forked from ringe/README.md
KVM QCOW2 Live backup

Live backup of KVM virtual machines

This script will let you make backups of live VMs running on KVM, using libvirt.

The backup job will suspend the VM for the time it takes to copy the RAM to disk.

Credits: Luca Lazzeroni

I've made some minor adjustments.