Skip to content

Instantly share code, notes, and snippets.

@andrewlimaza
andrewlimaza / example.html
Created December 19, 2016 11:31
Print certain div / elements using window.print()
<script>
function printDiv(divName){
var printContents = document.getElementById(divName).innerHTML;
var originalContents = document.body.innerHTML;
document.body.innerHTML = printContents;
window.print();
document.body.innerHTML = originalContents;
@drfraker
drfraker / Live Template For PHPUnit Tests
Last active March 26, 2022 17:05
Live Template For PHPUnit Tests
// 1. In PhpStorm go to: Preferences > Editor > Live Templates.
// 2. Click on the + button on the top right to create a new template.
// 3. Enter "@test" (no quotes) in the Abbreviation field, and give the template a name. (mine is named test case)
// 4. Copy and paste the code below into the "Template text:" section in PhpStorm
/** @test */
$NAME$
public function $SNAKENAME$()
{
$END$
<?php
/**
* Refactor #1:
*/
// Before
if ($user->type === 'admin' || $user->type === 'mod' || $user->type === 'author') {
// Do something.
}
@pxlrbt
pxlrbt / Readme.md
Last active September 30, 2022 20:20
Filament Geocoder

Usage

  • Install Geocoder Laravel: https://geocoder-php.org/docs/
  • Publish config php artisan vendor:publish (Look for Geocoder)
  • Setup your Google Geocoding API-Key in config/geocoder.php