Skip to content

Instantly share code, notes, and snippets.

View marlocorridor's full-sized avatar
🏠
Working from home

mcorridor marlocorridor

🏠
Working from home
View GitHub Profile
@dobesv
dobesv / dev_signed_cert.sh
Last active March 21, 2024 07:47
Script to create (1) a local certificate authority, (2) a host certificate signed by that authority for the hostname of your choice
#!/usr/bin/env bash
#
# Usage: dev_signed_cert.sh HOSTNAME
#
# Creates a CA cert and then generates an SSL certificate signed by that CA for the
# given hostname.
#
# After running this, add the generated dev_cert_ca.cert.pem to the trusted root
# authorities in your browser / client system.
#
@rhukster
rhukster / sphp.sh
Last active March 30, 2024 10:41
Easy Brew PHP version switching (Now moved to https://github.com/rhukster/sphp.sh)
#!/bin/bash
# Creator: Phil Cook
# Modified: Andy Miller
#
# >>> IMPORTANT: Moved to: https://github.com/rhukster/sphp.sh
# >>> Kept here for legacy purposes
#
osx_major_version=$(sw_vers -productVersion | cut -d. -f1)
osx_minor_version=$(sw_vers -productVersion | cut -d. -f2)
osx_patch_version=$(sw_vers -productVersion | cut -d. -f3)
@ostark
ostark / cloudflareWhitelistUpdate.php
Last active April 15, 2019 06:40
Updates the .htaccess with the recent ClouldFlare IPs
<?php
# Exec during deployment
# php cloudflareWhitelistUpdate.php public/.htaccess
$srcUrls = [
'https://www.cloudflare.com/ips-v4',
'https://www.cloudflare.com/ips-v6'
];
$htacessFile = $argv[1] ?? '.htaccess';
@kleo
kleo / backspace.md
Last active July 28, 2023 17:59
backspace

Project moved due to excessive amount of unicorns. Repo https://git.io/adminpldt

Our community of amazing people. Managed by a cat. Backspace https://discord.gg/C43625u

Gist here will not be updated anymore Discussion here on Gist is still allowed but I strongly recommend going over to the repository or Discord chat


@dejancencelj
dejancencelj / MSWordHtmlCleaners.js
Created July 27, 2017 19:51 — forked from ronanguilloux/MSWordHtmlCleaners.js
2 js solutions to clean nasty MS Word HTML pasted in any CMS + 2 server-side tips
var CleanWordHTML = function ( str )
{
str = str.replace(/<o:p>\s*<\/o:p>/g, "") ;
str = str.replace(/<o:p>.*?<\/o:p>/g, "&nbsp;") ;
str = str.replace( /\s*mso-[^:]+:[^;"]+;?/gi, "" ) ;
str = str.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, "" ) ;
str = str.replace( /\s*MARGIN: 0cm 0cm 0pt\s*"/gi, "\"" ) ;
str = str.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, "" ) ;
str = str.replace( /\s*TEXT-INDENT: 0cm\s*"/gi, "\"" ) ;
str = str.replace( /\s*TEXT-ALIGN: [^\s;]+;?"/gi, "\"" ) ;
@iffy
iffy / .gitignore
Last active April 17, 2024 07:19
Example using electron-updater with `generic` provider.
node_modules
dist/
yarn.lock
wwwroot
@barbietunnie
barbietunnie / laravel-production-permissions.md
Last active June 19, 2023 06:04
MySQL Database User GRANT permissions for Laravel

MySQL Database User GRANT permissions for Laravel

For security reasons, you should probably grant select, delete, update and insert to your app user in production.

Have another user who can do alter, create, drop and index when running migrations.

If you run seeders in production, also grant select, insert and references to the migration user.

Yeah, 2 users, migrations are not always run in production everyday and this keeps more secure your database.

@marlocorridor
marlocorridor / laravel_seeder.sh
Last active December 15, 2016 14:06
Make laravel seeder work properly - solves class not found
# To work something like
# php .\artisan db:seed --class=UsersTableSeeder
# where `UsersTableSeeder` is a newly created class on seeder file
# you need to execute this first
composer dump-autoload
# Reference :)
#http://laravel.io/forum/01-31-2015-laravel5-seeder-reflectionexception-class-tableseeder-does-not-exist-in-illuminatecontainercontainerphp776
# You should never forget, even when it sounds dummy to dump the autoload files with the command "composer dump-autoload" to make the seeders work properly.
@marlocorridor
marlocorridor / callout.scss
Last active November 9, 2016 03:43 — forked from mattsimpson/docs style (bootstrap)
This is the Twitter Bootstrap documentation's callout css. Looks nice.
// Brands
$brand-primary: #3097D1;
$brand-info: #8eb4cb;
$brand-success: #2ab27b;
$brand-warning: #cbb956;
$brand-danger: #bf5329;
.bs-callout {
padding: 20px;
margin: 20px 0;
@mrabbani
mrabbani / mailgun-config.md
Last active January 8, 2024 01:45
Laravel Mailgun Setup