Skip to content

Instantly share code, notes, and snippets.

View evansims's full-sized avatar

Evan Sims evansims

View GitHub Profile
@tprinty
tprinty / Adding Logging to Laravel Authentication
Last active March 21, 2024 18:01
Add Logging to Lavavel Authentication
Here is a quick way to add authentication logging to Laravel.
1. Modify app/Providers/EventServiceProvider.php and add lines 16 through 32 of the example file in this GIST.
2. Create a new file app/Listeners/LogActivity.php and copy the contents of the file below into that file.
3. Enjoy logging.
@Roukaysa
Roukaysa / worth.yml
Last active June 11, 2023 01:57 — forked from Yaroster/worth.yml
worth.yml 1.14 (EssentialsX)
# Created by X00LA
# Optimized by Yaroster
# Fixed, changed and completed by Roukaysa
# License: GPL2.0 https://github.com/X00LA/Bukkit-Essentials-worth.yml/blob/master/LICENSE
# Made for MC 1.13+ (Flattened)
# Optimized for ideal balanced Economy!
# Based on https://github.com/X00LA/Bukkit-Essentials-worth.yml
worth:
#Iron
-- This service checks all the servers in the named backend (see the
-- backend_name var). If _any_ of them are up, it returns 200 OK. If
-- they are all down it returns a 500 FAILED.
--
-- This is intended to be used as a HTTP health check from an upstream
-- load balancer, without this check the most intelligent health check
-- that could be performed is a simple TCP check on the HAProxy frontend.
-- This would not fail in the event that HAProxy cannot see *any* of its
-- downstream servers
<?php
const SLACK_TOKEN = '';
const SLACK_CHANNEL = '#worldcup';
const SLACK_BOT_NAME = 'World Cup';
const SLACK_BOT_AVATAR = 'https://i.imgur.com/Pd0cpqE.png';
function curl_get($url) {
$curl = curl_init();
curl_setopt_array($curl, array(
@giansalex
giansalex / docker-php-ext-install.md
Last active October 3, 2023 10:02
docker-php-ext-install Reference
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ 
@themanifold
themanifold / node-prune.sh
Last active October 1, 2022 02:47
Pruning useless node_modules with bash userland tools (find etc)
#!/usr/bin/env bash
find node_modules \( -name '__tests__' -o \
-name 'test' -o \
-name 'tests' -o \
-name 'powered-test' -o \
-name 'docs' -o \
-name 'doc' -o \
-name '.idea' -o \
-name '.vscode' -o \
-name 'website' -o \
@meanevo
meanevo / haproxy.cfg
Last active July 25, 2019 16:51
H2, HTTP/1.1 traffic balance/routing with HAProxy 1.7 (with SSL-Termination) and Nginx 1.10.2
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
daemon
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 2048
user haproxy
group haproxy
@santoshachari
santoshachari / Laravel PHP7 LEMP AWS.md
Last active February 20, 2024 10:00
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@ralph089
ralph089 / .wakeup
Last active February 17, 2024 09:56
Restarts Bluetooth Module on Mac OS X. You can use the script as shortcut to restart Bluetooth on demand or you can use it with "SleepWatcher" to automatically restart Bluetooth on wakeup (See README.md). I created it, because my Logitech Bluetooth Mouse doesn't stay connected after sleep-mode, so i had to manually re-pair my mouse.
#!/bin/bash
#
# Restart Bluetooth Module on Mac OS X
#
# Requires Blueutil to be installed: http://brewformulas.org/blueutil
BT="/usr/local/bin/blueutil"
log() {
echo "$@"
@danmactough
danmactough / add-collaborator.sh
Created October 12, 2015 16:04
I needed to add a read-only collaborator to many repositories, and doing it via the website was really tedious
#!/bin/bash
GITHUB_TOKEN=$(git config --global github.token) # I've defined an API token in my git config -- ymmv
GITHUB_USER="" # the collaborator
REPO_OWNER="" # the owner of the repos
REPOS="" # space-delimited list of repositories
PERMISSION="pull" # may be one of "admin", "push" (i.e., read/write -- default), or "pull" (i.e., read-only)
for REPO in ${REPOS} ; do
curl -X PUT -i -d '{ "permission": "'${PERMISSION}'" }' \
-H 'Accept: application/vnd.github.ironman-preview+json' \
-H "Authorization: token ${GITHUB_TOKEN}" \