Skip to content

Instantly share code, notes, and snippets.

<?php
/** @noinspection PhpUnused */
namespace App\Http\Livewire\Traits;
use Exception;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Gate;
use Livewire\Component;
@ju5t
ju5t / Transaction.php
Created June 29, 2022 14:38 — forked from Patabugen/Transaction.php
Eloquent Model event hook to allow inserting primary keys into SQL Server tables with IDENTITY_INSERT = off
<?php
trait PrimaryKey
{
protected $primaryKey = 'TransactionID';
public static function bootPrimaryKey()
{
static::creating(function(self $model) {
$pkColumn = $model->primaryKey;
$tableName = $model->table;
@ju5t
ju5t / instructions.md
Last active May 3, 2024 21:45
Livewire enabled TinyMCE blade component

Instructions

This is a very basic TinyMCE component. It uses 'entangle'. This allows you to link a Livewire and Alpine property to eachother. If one value changes, the other does too.

Installation

Add tinymce.blade.php to views/components/input. This can be another component folder too if you prefer, but keep in mind that you should also

variables:
K8S_NAMESPACE: $CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_SLUG
stages:
- deploy
deploy-k8s:
image: dtzar/helm-kubectl
stage: deploy
before_script:
#!/usr/bin/env bash
yum install -y php
cat <<\PHP > test.php
<?php
$domain = 'www.whmcs.com';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://' . $domain);
curl_setopt($ch, CURLOPT_CERTINFO, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@ju5t
ju5t / semantic-commit-messages.md
Created December 8, 2018 21:48 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

before_script:
- apt-get update -qq && apt-get install git zip unzip lftp -y
stages:
- deploy
deploy:
image: php:7.1
stage: deploy
environment:
@ju5t
ju5t / magento2.py
Last active March 12, 2018 13:38
#14054 Magento2 API
import os
import requests
# Magento
magento_endpoint = os.environ['MAGENTO_ENDPOINT']
magento_username = os.environ['MAGENTO_USERNAME']
magento_password = os.environ['MAGENTO_PASSWORD']
@ju5t
ju5t / app.py
Created June 18, 2017 18:08
A sample Flask application used with Enchant Customer Support Software
import hmac
import hashlib
import json
from flask import Flask, request
app = Flask(__name__)
# Get the security from your sidebar app settings
security_key = 'My-Enchant-Signature'
<?php
/*
* A example of how to generate WHMCS-ready dist.whois.json files.
*/
$whoisServers = [];
$tlds = [];
$xml = simplexml_load_file('https://raw.githubusercontent.com/whois-server-list/whois-server-list/master/whois-server-list.xml');
foreach ($xml->domain as $id => $domain) {