Skip to content

Instantly share code, notes, and snippets.

View abishekrsrikaanth's full-sized avatar
🏠
Working from home

Abishek R Srikaanth abishekrsrikaanth

🏠
Working from home
  • Greenlyst Inc.
  • Bangalore, India
View GitHub Profile
@abishekrsrikaanth
abishekrsrikaanth / html-toc.js
Created September 23, 2022 20:51 — forked from simov/html-toc.js
Generate Table of Contents (TOC) from rendered HTML document's header tags
// extract all headers
var headers = []
function walk (nodes) {
nodes.forEach((node) => {
var sub = Array.from(node.childNodes)
if (sub.length) {
walk(sub)
<?php
namespace App\Providers;
use App\Models\StripePlan;
use App\Models\Team;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;
<?php
namespace App\Models;
class User extends Authenticatable implements MustVerifyEmail
{
public function plan(): BelongsTo
{
return $this->hasOne(StripePlanUser::class);
<?php
namespace App\Providers;
use App\Models\StripePlan;
use App\Models\Team;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;
<?php
namespace App\Observers;
use App\Models\StripePlan;
use App\Shared\Services\Stripe\API as StripeAPI;
class StripePlanObserver
{
public function created(StripePlan $stripePlan): void
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateStripePlansTable extends Migration
{
public function up(): void
{
<?php
use App\Models\StripePlan;
use Laravel\Nova\Observable;
use App\Observers\StripePlanObserver;
/**
* Bootstrap any application services.
*
* @return void
<?php
namespace App\Shared\Stripe;
use DomainException;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
use Stripe\Exception\ApiErrorException;
use Stripe\Plan;
use Stripe\Product;
<?php
namespace App\Nova\Resources;
class Plan extends Resource
{
public function fields(Request $request): array
{
return [
Text::make('Name'),
defaults write -g InitialKeyRepeat -int 10
defaults write -g KeyRepeat -int 1
defaults write http://com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false
defaults write com.apple.dock static-only -bool TRUE; killall Dock