Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tompec
tompec / laravel-versions.py
Created October 13, 2021 04:44
Get the Laravel version for your local repositories
# Quick script to list the versions of your Laravel repositories.
# Replace repositories_folder with the path to your repositories folder,
# then run `python laravel-versions.py`
import os
import json
repositories_folder = "/Users/Thomas/code/"
results = {}
@tompec
tompec / EmailLog.php
Created January 9, 2020 08:58
Laravel Nova resource for the EmailLog model from https://github.com/tompec/laravel-email-log
<?php
namespace App\Nova;
use Illuminate\Http\Request;
use Laravel\Nova\Fields\Boolean;
use Laravel\Nova\Fields\DateTime;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\MorphOne;
use Laravel\Nova\Fields\Text;
@tompec
tompec / mailchimp-newsletter-bulma.html
Created October 7, 2017 10:31
Simple Bulma template for Mailchimp embedded form with input group
<!DOCTYPE html>
<html>
<head>
<title>Mailchimp newsletter</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.5.3/css/bulma.min.css" crossorigin="anonymous">
<style>
div.mce_inline_error {
color: red;
@tompec
tompec / mailchimp-newsletter-bootstrap.html
Last active August 27, 2020 14:08
Simple Bootstrap template for Mailchimp embedded form with input group
<!DOCTYPE html>
<html>
<head>
<title>Mailchimp newsletter</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<style>
div.mce_inline_error {
color: red;
@tompec
tompec / gist:bc546b2222b233e571bec987904a797b
Created June 22, 2017 09:45
Redirect IP to domain name in NGINX
server {
server_name 123.456.789.123;
return 301 $scheme://www.domain.com$request_uri;
}
@tompec
tompec / gist:5d2d7b51c918c5c1429c503b9109b57b
Created May 20, 2017 10:18
Leverage browser caching for Nginx server
server {
# Leverage browser caching
location ~* \.(jpg|jpeg|png|gif|ico|css|js|pdf)$ {
expires 7d;
}
}
@tompec
tompec / bulma.blade.php
Last active September 10, 2020 20:33
Bulma blade template for Laravel 5.4 pagination
@if ($paginator->hasPages())
<nav class="pagination is-centered">
@if ($paginator->onFirstPage())
<a class="pagination-previous" disabled>Previous</a>
@else
<a href="{{ $paginator->previousPageUrl() }}" rel="prev" class="pagination-previous">Previous</a>
@endif
@if ($paginator->hasMorePages())
<a class="pagination-next" href="{{ $paginator->nextPageUrl() }}" rel="next">Next</a>