Skip to content

Instantly share code, notes, and snippets.

@sprobejames
sprobejames / .gitignore
Created September 24, 2024 05:11
How to set up Prettier On a Laravel App, Linting Tailwind Class Order and More see https://mattstauffer.com/blog/how-to-set-up-prettier-on-a-laravel-app-to-lint-tailwind-class-order-and-more/
node_modules
dist
.env*
vendor/
/vendor
public/
.git
**/.git
package-lock.json
composer.lock
@sprobejames
sprobejames / csr.sh
Created September 24, 2024 03:21
Generate command for CSR. see UI https://www.digicert.com/easy-csr/openssl.htm
#!/bin/bash
openssl req -new -newkey rsa:2048 -nodes -out example_com.csr -keyout example_com.key -subj "/C=US/ST=California/L=Los Angeles/O=My Company Name/OU=IT/CN=example.com"
@sprobejames
sprobejames / AttachmentController.php
Last active September 24, 2024 00:51 — forked from zahidhasanemon/Controller.php
Multiple file upload asynchronously using Laravel and Dropzone JS. Works perfectly with multiple files dragged and dropped or selected at a time. Images are uploaded via ajax request.
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class AttachmentController extends Controller
{
public function store(Request $request)
{
<?php
<x-multi-select
model="some_public_property"
class="select-custom"
placeholderValue="Select all you want"
:options="[['label' => 'FOO', 'value' => 'foo'], ['label' => 'BAR', 'value' => 'bar']]"
/>
const fs = require('fs');
const { Readable } = require('stream');
const sharp = require('sharp');
const svgToPng = (svgString) => {
return new Promise((resolve, reject) => {
const svgStream = new Readable();
svgStream.push(svgString);
svgStream.push(null);
svgStream.pipe(sharp()
#!/bin/bash
git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -; done
import { Controller, useForm } from 'react-hook-form'
import DatePicker from 'react-datepicker'
const App = () => {
const { control, register, handleSubmit } = useForm();
const onSubmit = (data) => {
alert(JSON.stringify(data));
};
@sprobejames
sprobejames / tree.css
Created June 20, 2024 01:54 — forked from dylancwood/tree.css
CSS to create a simple tree structure with connecting lines. No images or JS required.
ul.tree, ul.tree ul {
list-style: none;
margin: 0;
padding: 0;
}
ul.tree ul {
margin-left: 10px;
}
ul.tree li {
margin: 0;
{
"AF": {
"name": "Afghanistan",
"region": "Asia",
"timezones": {
"Asia\/Kabul": "+04:30"
},
"iso": {
"alpha-2": "AF",
"alpha-3": "AFG",