Skip to content

Instantly share code, notes, and snippets.

View ffmit's full-sized avatar
🎯
Focusing

ffmit

🎯
Focusing
View GitHub Profile
@karlhillx
karlhillx / laravel-mix-font-awesome.md
Last active December 21, 2022 15:35
Want to use Laravel and Font Awesome? (Regularly updated)

Laravel Mix & Font Awesome Setup: Compiling Assets

This document provides help on getting your Laravel instance running with the latest versions of Laravel Mix and Font Awesome. Note: This guide is for Laravel versions 5 through 7. If you are using Laravel 8, please go here.

Laravel Mix
@xarmengol
xarmengol / SetLocale.md
Last active February 6, 2024 01:46
Set locale for authenticated users in laravel

Intro

What we want to do is to set the locales of a laravel 5.6 application, by depending of the language of the authenticated user. We store the language preferences of a user on the database, in the users table.

Steps

Create a new Middleware:

php artisan make:middleware AuthUserSetLocale
@oseiskar
oseiskar / swagger-yaml-to-html.py
Last active April 30, 2024 10:57
Converts Swagger YAML to a static HTML document (needs: pip install PyYAML)
#!/usr/bin/python
#
# Copyright 2017 Otto Seiskari
# Licensed under the Apache License, Version 2.0.
# See http://www.apache.org/licenses/LICENSE-2.0 for the full text.
#
# This file is based on
# https://github.com/swagger-api/swagger-ui/blob/4f1772f6544699bc748299bd65f7ae2112777abc/dist/index.html
# (Copyright 2017 SmartBear Software, Licensed under Apache 2.0)
#
@shyd
shyd / Dockerfile
Last active February 4, 2024 12:17
install php imap in dockerfile
FROM php:5-apache
RUN apt-get update && \
apt-get install -y \
libc-client-dev libkrb5-dev && \
rm -r /var/lib/apt/lists/*
RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \
docker-php-ext-install -j$(nproc) imap
@taldanzig
taldanzig / osxvpnrouting.markdown
Created January 24, 2013 22:14
Routing tips for VPNs on OS X

Routing tips for VPNs on OS X

When VPNs Just Work™, they're a fantastic way of allowing access to a private network from remote locations. When they don't work it can be an experience in frustration. I've had situations where I can connect to a VPN from my Mac, but various networking situations cause routing conflicts. Here are a couple of cases and how I've been able to get around them.

Specific cases

Case 1: conflicting additional routes.

In this example the VPN we are connecting to has a subnet that does not conflict with our local IP, but has additional routes that conflict in some way with our local network's routing. In my example the remote subnet is 10.0.x.0/24, my local subnet is 10.0.y.0/24, and the conflicting route is 10.0.0.0/8. Without the later route, I can't access all hosts on the VPN without manually adding the route after connecting to the VPN:

@bradgorman
bradgorman / gist:4247000
Created December 9, 2012 21:02 — forked from codeincontext/gist:3862543
JavaScript - iOS/Safari Photo Upload, Manipulation
<!DOCTYPE html>
<html>
<head>
<title>iOS6 Safari Photo Capture Demo</title>
<script type="text/javascript">
window.onload = function() {
var input = document.getElementById("input");
input.addEventListener("change", handleFile);
}