Skip to content

Instantly share code, notes, and snippets.

View lighth7015's full-sized avatar
Perpetually exhausted.

Robert Butler lighth7015

Perpetually exhausted.
View GitHub Profile
@lighth7015
lighth7015 / DialogProvider.tsx
Created February 23, 2024 02:09
Dialog Provider
import React, { createContext, useContext, useState, FunctionComponent, useEffect } from 'react';
import { Dialog, Button } from '@mui/material';
type DialogProviderProps = React.PropsWithChildren;
type DialogContent = { component: FunctionComponent<any> | null; props: any; };
type ShowDialogFn = ( component: FunctionComponent<any>, props?: any ) => void;
type DialogCtx = { showDialog: ShowDialogFn; closeDialog: VoidFunction; open: boolean; content: DialogContent; };
const DialogContext = createContext<DialogCtx | undefined>( undefined );
@lighth7015
lighth7015 / template.php
Last active October 23, 2022 03:01
Issue querying for namespaced child fragments.
<?php
$template =<<<EOF
<!DOCTYPE html>
<html xmlns:x="http://schema.hpprx.com/schemas">
<head></head>
<body>
<div x:for-each="(foo, i) of bar">
a
</div>
</body>
# The Caddyfile is an easy way to configure your Caddy web server.
# https://caddyserver.com/docs/caddyfile
#
# The configuration below serves a welcome page over HTTP on port 80. To use your
# own domain name (with automatic HTTPS), first ensure that your domain's A/AAAA
# DNS records are properly pointed to this machine's public IP, simply replace the line below with your
# domain name.
#
# https://caddyserver.com/docs/caddyfile/concepts#addresses
@lighth7015
lighth7015 / cors.php
Created May 12, 2022 15:19
config/cors.php
<?php
/**
* ------------------------------------------------------------------------------------
* Cross-Origin Resource Sharing (CORS) Configuration
* ------------------------------------------------------------------------------------
*
* Here you may configure your settings for cross-origin resource sharing or CORS. This
* determines what cross-origin operations may execute in web browsers. You are free to
* adjust these settings as needed.
*
[{
"id": 99,
"account": {
"first": "First",
"middle": "",
"last": "Last",
"email": "email@addr.tld",
"email_verified_at": {
"$date": "2022-01-04T23:49:25"

Angular compile message(s):

Error: src/app/app.component.html:74:2 - error NG8001: 'app-page' is not a known element:
1. If 'app-page' is an Angular component, then verify that it is part of this module.
2. If 'app-page' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.

74  <app-page></app-page>
    ~~~~~~~~~~
@lighth7015
lighth7015 / campaign.php
Last active October 30, 2021 18:23
Expected output vs. Actual output
<?php
$format = 'Va*';
die(print_r(unpack($format, pack($format, time(), "test")), true ));
/**
* Expected output:
* Array
* (
* [V] => 1635617836
@lighth7015
lighth7015 / efl-hello.log
Last active October 28, 2021 06:48
efl-hello.log
ERR<1295565>:eina_safety ../src/lib/efreet/efreet_ini.c:412 efreet_ini_localestring_get() safety check failed: ini->section == NULL
## Copy & Paste the below (until EOF) into a terminal, then hit Enter
eina_btlog << EOF
/usr/lib/libeina.so.1 0x7fd972d29b84 0x7fd972cff000
/usr/lib/libeina.so.1 0x7fd972d2adc1 0x7fd972cff000
/usr/lib/libeina.so.1 0x7fd972d2c469 0x7fd972cff000
/usr/lib/libeina.so.1 0x7fd972d44c04 0x7fd972cff000
/usr/lib/libefreet.so.1 0x7fd972da7c24 0x7fd972d9b000
/usr/lib/efreet/v-1.25/efreet_icon_cache_create 0x55f8ee6af785 0x55f8ee6ab000
@lighth7015
lighth7015 / angular.json
Last active October 20, 2021 11:45
Generating browser application bundles (phase: setup)...Error: ENOENT: no such file or directory, open '/home/robert_/TS/ng/rxmark/src/main.ts'
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"cli": {
"packageManager": "yarn"
},
"newProjectRoot": "projects",
"projects": {
"app": {
"projectType": "application",
@lighth7015
lighth7015 / Family.php
Created October 11, 2021 20:43
Blade Card component + two widgets that use the card component
<?php
namespace App\Widgets;
class Family extends Widget {
/**
* The configuration array.
*
* @var array
*/
protected $config = [];