Skip to content

Instantly share code, notes, and snippets.

View mpociot's full-sized avatar

Marcel Pociot mpociot

View GitHub Profile
<h1>Hello {{ $name }}</h1>
<?php
use Tinkerwell\ContextMenu\Label;
use Tinkerwell\ContextMenu\Submenu;
use Tinkerwell\ContextMenu\SetCode;
use Tinkerwell\ContextMenu\OpenURL;
class CustomLumenTinkerwellDriver extends TinkerwellDriver {
/**
<html class="h-full">
<body class="h-full">
<link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet">
<div class="h-full w-full flex items-center justify-center">
<h1 class="text-3xl">Welcome to {{ $title }}</h1>
</div>
</body>
</html>
@mpociot
mpociot / SingletonModel.php
Created January 24, 2020 13:59
Making it easier to work with single row models in Laravel
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class SingletonModel extends Model
{
protected function store($data = [])
{
#!/bin/bash
PLATFORM=iPhoneOS # iPhoneSimulator # iPhoneOS
HOST=arm-apple-darwin # i386-apple-darwin10 # arm-apple-darwin10
ARCH=arm64 # i386 # armv7s #armv7
SDK_VERSION=13.0
XCODE_ROOT=`xcode-select -print-path`
PLATFORM_PATH=$XCODE_ROOT/Platforms/$PLATFORM.platform/Developer
SDK_PATH=$PLATFORM_PATH/SDKs/$PLATFORM$SDK_VERSION.sdk
@mpociot
mpociot / LaravelTinkerwellDriver.php
Created November 21, 2019 16:25
Custom Tinkerwell drivers
<?php
namespace BeyondCode\Tinkerwell\Drivers;
class LaravelTinkerwellDriver extends TinkerwellDriver
{
public function canBootstrap($projectPath): bool
{
return file_exists($projectPath.'/public/index.php') &&
file_exists($projectPath.'/artisan');
@mpociot
mpociot / tinker
Last active March 21, 2024 18:30
Python script to open Tinkerwell from your current working directory - tinkerwell.app
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
RUN_PATH = '/Applications/Tinkerwell.app'
def process_args(argv):
args = []
@mpociot
mpociot / CanBeReplicated.php
Created June 12, 2019 12:32
Add the ability to replicate Laravel models to other models.
<?php
use Illuminate\Support\Arr;
trait CanBeReplicated
{
public function replicateTo(string $model, array $with = null, array $except = null)
{
$defaults = [
$this->getKeyName(),
@mpociot
mpociot / 01-quaderno-js-v2.md
Created March 1, 2019 09:12 — forked from xxswingxx/01-quaderno-js-v2.md
Quaderno.js v2 reference (deprecated)

Quaderno.js v2 Reference (deprecated)

Quaderno.js is a simple javascript library that allows you to process payments, calculate sales taxes (VAT, GST, etc.) on the fly, and send beautiful tax receipts to your customers.

Note: For more help, take a look at our examples.

Including Quaderno.js

Add these script tags to your page to get started with Quaderno.js.
@mpociot
mpociot / quaderno-checkout-v2.md
Created March 1, 2019 09:06 — forked from xxswingxx/quaderno-checkout-v2.md
Quaderno Checkout v2 reference (deprecated)