Skip to content

Instantly share code, notes, and snippets.

View chistel's full-sized avatar
:octocat:

Chistel chistel

:octocat:
  • PC
View GitHub Profile
@astuyve
astuyve / deny_snippet.json
Created January 17, 2024 15:00
Deny cloudwatch permissions from Lambda to save money
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
<?php
use Illuminate\Foundation\Testing\RefreshDatabase;
use Symfony\Component\Console\Output\BufferedOutput;
use function Termwind\render;
use function Termwind\renderUsing;
uses(RefreshDatabase::class);
test('there are no down migrations', function () {
@wmandai
wmandai / AppServiceProvider.php
Created June 23, 2021 21:21 — forked from greenspace10/AppServiceProvider.php
Laravel, Livewire, Alpine JS Toast Notifications
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Component::macro('notify', function ($message, $title = '', $type = 'success') {
$this->dispatchBrowserEvent('notify', ['message' => $message, 'title' => $title, 'type' => $type]);
});
PORTAL_DOMAIN=localhost
SESSION_DRIVER=shared
@gwleuverink
gwleuverink / progress-bar.blade.php
Last active April 9, 2024 10:31
Progress bar blade component
@props([
'percentage' => 0,
'failed' => false
])
@php
$done = $failed || $percentage == 100;
@endphp
<div {{ $attributes->merge(['class' => ' space-y-1'])->whereDoesntStartWith('wire:poll') }}
@herablog
herablog / cwv-report-to-slack-gas.js
Last active January 10, 2024 09:01
CWV (Core Web Vitals) Report to Slack with CrUX API
/**
* This is an example code for Google App Script
* You can run this script with time-driven triggers
* @see https://developers.google.com/apps-script/guides/triggers/installable#time-driven_triggers
*/
// Settings
const CRUX_ORIGINS = []; // e.g. https://example.com
const CRUX_METRICS = ['first_input_delay', 'largest_contentful_paint', 'cumulative_layout_shift']; // first_contentful_paint, first_input_delay, largest_contentful_paint, cumulative_layout_shift
const CRUX_FORM_FACTOR = ['PHONE', 'DESKTOP']; // ALL_FORM_FACTORS, PHONE, DESKTOP, TABLET
@ameen-sarsour
ameen-sarsour / PHP apple sign in
Last active September 3, 2024 09:44
this code to try php sign in,
<?php
/**
* This file to test apple sign in,
* Need to app information from Apple
*
* Team Id
* Client Id
* Key Id
* and Private key
@JeffreyWay
JeffreyWay / demo.html
Created June 29, 2020 14:08
Alpine.js Transition demo
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Alpine Examples</title>
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.x.x/dist/alpine.min.js"
defer
></script>
<iframe src="<?php echo $url; ?>" width='100%' height='100%' allowfullscreen webkitallowfullscreen></iframe>
@marcus-at-localhost
marcus-at-localhost / alpine-js-fetch-data-on-x-init.markdown
Last active November 25, 2022 08:20
[Alpine.js fetch data on `x-init`] #js #alpinejs