Skip to content

Instantly share code, notes, and snippets.

View srdjanmarjanovic's full-sized avatar

Srdjan Marjanovic srdjanmarjanovic

View GitHub Profile
@slava-vishnyakov
slava-vishnyakov / readme.md
Last active September 11, 2024 11:38
How to upload images with TipTap editor
  1. Create a file Image.js from the source below (it is almost a copy of Image.js from tiptap-extensions except that it has a constructor that accepts uploadFunc (function to be called with image being uploaded) and additional logic if(upload) { ... } else { ... previous base64 logic .. } in the new Plugin section.
import {Node, Plugin} from 'tiptap'
import {nodeInputRule} from 'tiptap-commands'

/**
 * Matches following attributes in Markdown-typed image: [, alt, src, title]
 *
@chinleung
chinleung / install-laravel-nova-in-subfolder.md
Last active June 22, 2023 19:41
Installing Laravel Nova in subfolder

Instsalling Laravel Nova in a subfolder

This is a guide that will show you how to install Laravel Nova in a subfolder of a domain.

Clone the repository

Clone the repository in the home directory of the cPanel user.

cd /home/user
@calebsmithdev
calebsmithdev / app.blade.php
Created September 21, 2017 02:30
Vue Paper Dashboard Pro and Laravel
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="apple-touch-icon" sizes="76x76" href="static/img/apple-icon.png">
<link rel="icon" type="image/png" sizes="96x96" href="static/img/favicon.png">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>Vue Paper Dashboard</title>
<!-- Bootstrap core CSS -->
@DragonBe
DragonBe / FinalClass.php
Created July 20, 2017 15:05
Testing final classes is tricky, but possible even though you cannot directly mock a "final" class
<?php
namespace FinalClass;
require_once __DIR__ . '/vendor/autoload.php';
use PHPUnit\Framework\TestCase;
final class Foo
{
protected $bar;
@ksassnowski
ksassnowski / functor.php
Last active October 15, 2021 12:50
Playing around with functors in PHP
<?php
interface Functor
{
// fmap :: Functor f => (a -> b) -> f a -> f b
public function fmap(callable $fn): Functor;
}
class Fn implements Functor
{
@gkhays
gkhays / DrawSineWave.html
Last active August 27, 2024 23:59
Oscillating sine wave, including the steps to figuring out how to plot a sine wave
<!DOCTYPE html>
<html>
<head>
<title>Sine Wave</title>
<script type="text/javascript">
function showAxes(ctx,axes) {
var width = ctx.canvas.width;
var height = ctx.canvas.height;
var xMin = 0;
@gvsrepins
gvsrepins / Envoy.blade.php
Last active July 13, 2023 17:40
A Laravel envoy script for deployment
@servers(['production' => 'productionserver', 'local'=> 'vagrant@127.0.0.1 -p 2222'])
{{-- Configuration section --}}
@setup
/*
|--------------------------------------------------------------------------
| Git Config
|--------------------------------------------------------------------------
|
@jaydenseric
jaydenseric / ffmpeg-web-video-guide.md
Last active September 19, 2024 14:45
A quick guide to using FFmpeg to create cross-device web videos.

Video conversion with FFmpeg

Install

On mac:

  1. Download the latest release.
  2. Extract the binary and place it in /usr/local/bin.

Command basics

@tabacitu
tabacitu / gist:dbcfd71375e72c857474
Last active April 20, 2020 09:05
Tabacitu Laravel Package Service Provider boilerplate code
<?php
namespace League\Skeleton;
use Illuminate\Support\ServiceProvider;
use Illuminate\Routing\Router;
class SkeletonServiceProvider extends ServiceProvider
{
/**
@pjdietz
pjdietz / cloudSettings
Last active June 18, 2020 22:29
Testing Protected Method of Abstract Class with PHPUnit
{"lastUpload":"2020-06-18T22:29:09.889Z","extensionVersion":"v3.4.3"}