Skip to content

Instantly share code, notes, and snippets.

View jarrettbarnett's full-sized avatar

Jarrett Barnett jarrettbarnett

View GitHub Profile
@armorasha
armorasha / config.php_cs
Last active March 26, 2021 14:42
Your "php-cs-fixer.config": ".php_cs;.php_cs.dist" file. Just download this file and use it. I prefer to keep the file name config.php_cs
<?php
return PhpCsFixer\Config::create()
->setRules(array(
'@PSR2' => true,
'indentation_type' => true,
// for indentation to work: 1 of 2. Works!
'array_indentation' => true,
@messi89
messi89 / PassportToken.php
Last active April 4, 2023 12:08
Laravel Passport getBearerTokenByUser (Get AccessToken from User) - Laravel 6.x updated
<?php
namespace App\Traits;
use DateTimeImmutable;
use Laravel\Passport\Bridge\Scope;
use Modules\User\Models\User;
use GuzzleHttp\Psr7\Response;
use Illuminate\Events\Dispatcher;
use Laravel\Passport\Bridge\AccessToken;
@jasonmccreary
jasonmccreary / .php_cs.laravel.php
Created August 9, 2019 14:18 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'binary_operator_spaces' => [
'operators' => ['=>' => null]
],
'blank_line_after_namespace' => true,
@yugaego
yugaego / install.md
Last active June 13, 2019 18:34
Mac OS 10.13 High Sierra Install PHP 7.0 Apache MariaDB With Homebrew
@TimBHowe
TimBHowe / functions.php
Created March 8, 2016 17:54
Forcibly remove the tax line item and calculation from the cart. (suggest just using the GEO setting in WooCommerce)
<?php
// Remove the Tax Line item from the cart.
function wc_remove_cart_tax_totals( $tax_totals, $instance ) {
if( is_cart() ) {
$tax_totals = array();
}
return $tax_totals;
}
@subfuzion
subfuzion / curl.md
Last active June 14, 2024 20:32
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@erichrobinson
erichrobinson / README.md
Last active February 24, 2024 08:32
SwitchResX Configuration

#SwitchResX Settings for LG 21:9 UltraWide

SwitchResX is a utility that allows users to override the default resolution settings in OSX. For more information, including download links, vist http://www.madrau.com/ .

##Disabling System Integrity Protection (SIP)

If you are running OSX 10.11 or higher, SIP must be disabled. To disable SIP do the following:

  • Boot into the recovery partition by pressing CMD + R when starting up your Mac.
  • Once in recovery mode, open a terminal window.
  • Type the command csrutil disable
@nrollr
nrollr / Ruby_and_Rails.md
Last active March 28, 2018 17:57
Ruby and Rails on El Capitan

#Install Ruby and Rails on El Capitan The following procedure was used to install the required components on El Capitan (clean install)

First make sure Xcode Command Line Tools are installed.
Open Terminal and enter: xcode-select --install you will be prompted to start the installation. Once finished proceed..

##Install Homebrew Important Notice: Homebrew and El Capitan, make sure to read the article!

  • Enter the following command: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
#!/bin/bash
#
# Simple Main Logic Board (MLB) Serial Generator Script by TheRacerMaster
# Based off the work of Hanger1, AGuyWhoIsBored & Alien:X
# NOTE: This is a simple script that doesn't do any checking of other SMBIOS values. It needs valid SMBIOS data which includes the following:
# - Valid SmUUID value in Clover config.plist under SMBIOS (generated using uuidgen)
# - ROM value set to UseMacAddr0 in Clover config.plist (uses MAC address of your first NIC as ROM value)
# - Properly formatted serial number (doesn't have to be a real one, just formatted properly) in Clover config.plist under SMBIOS
# - Don't use a generic serial number (such as Clover's default)! It needs to be at least semi-unique.
# - Try using a generated serial number that isn't real (but formatted correctly) from Clover Configurator, Chameleon Wizard, etc.
@umidjons
umidjons / random-hash-string-php.md
Created April 29, 2015 10:56
Generate random hash string in PHP

Generate random hash string in PHP

<?php
function randHash($len=32)
{
	return substr(md5(openssl_random_pseudo_bytes(20)),-$len);
}