Skip to content

Instantly share code, notes, and snippets.

View bendo01's full-sized avatar

Benny Leonard Enrico Panggabean bendo01

View GitHub Profile
@MatinMN
MatinMN / Laravel Alpine JS Modal
Last active June 5, 2024 10:36
Laravel Modal Component
// open modal from livewire component
$this->dispatch('open-modal', name: 'user-details');
// close modal
$this->dispatch('close-modal');
@cmer
cmer / LICENSE
Last active July 21, 2024 18:42
Tom-Select.js Tailwind UI theme
Copyright 2023 Carl Mercier
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHE
@tatsuyasusukida
tatsuyasusukida / !README-javascript-media-video.md
Last active July 16, 2024 20:39
🎥 How to record a video with JavaScript [demo video available]

🎥 How to record a video with JavaScript [demo video available]

Demo video: How to record a video with JavaScript

About this article

This article describes how to shoot a video from JavaScript using the MediaStream Recording API. The related resources are shown below.

@uint0
uint0 / Cargo.toml
Created July 14, 2021 12:39
Rust File Upload
[package]
name = "file-receiver"
version = "0.1.0"
authors = ["uint0 <uint0@zeta-mechanic>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
actix-web = "3"
@oschannel
oschannel / pyenv_basics_cheatsheet.md
Last active April 17, 2022 09:16
PYENV BASICS CHEATSHEET | by OsChannel.com

Watch a video tutorial about below on OsChannel.com: https://youtu.be/WVISFQpstJE

PyEnv Basics Cheatsheet Contains:

  • Installation of PyEnv.
  • Installation of Multiple Python versions including a macOS Fix.
  • Setting Different Python versions for your Projects using multiple ways.
  • Swiching between Python Versions using PyEnv.

To Install pyenv:

@mithicher
mithicher / tom-select.blade.php
Last active July 24, 2024 20:54
Tom Select Livewire Blade Component
/* Component Usage
// Data for options
$users = \App\User::limit(6)->get()->transform(fn($user) => [
'id' => $user->id,
'title' => $user->name,
'subtitle' => $user->email
]);
// Usage in view
@giuliano-macedo
giuliano-macedo / download_file.rs
Last active January 25, 2024 08:52
Download large files in rust with progress bar using reqwest, future_util and indicatif
// you need this in your cargo.toml
// reqwest = { version = "0.11.3", features = ["stream"] }
// futures-util = "0.3.14"
// indicatif = "0.15.0"
use std::cmp::min;
use std::fs::File;
use std::io::Write;
use reqwest::Client;
use indicatif::{ProgressBar, ProgressStyle};
@tumainimosha
tumainimosha / page-info.ts
Last active July 10, 2024 01:20
NestJS Graphql Cursor Based pagination
import { ObjectType, Field } from "@nestjs/graphql";
@ObjectType()
export class PageInfo {
@Field({ nullable: true })
startCursor: string;
@Field({ nullable: true })
endCursor: string;
@tanthammar
tanthammar / session-timeout-alert-after-livewire-scripts.blade.php
Last active November 23, 2023 11:50
Laravel Livewire Turbolinks Blade component to keep session alive
{{-- You do not need to add this component if you are using the permanent option in the head component --}}
<script>
if (!window.sessionTimerPermanent && window.Livewire) {
window.livewire.hook('afterDomUpdate', startSessionTimer)
}
// if you are on livewire > 1.3.1 and want to avoid the default error alert
// https://github.com/livewire/livewire/pull/1146
window.livewire.onError(statusCode => {
if (statusCode === 419) {
@hnakamur
hnakamur / Dockerfile
Created June 11, 2020 00:27
Dockefile to build nginx-quic with BoringSSL on Ubuntu 20.04 LTS
FROM ubuntu:20.04
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install git mercurial build-essential cmake ninja-build golang-go zlib1g-dev libpcre3-dev
RUN git clone https://github.com/google/boringssl \
&& cd boringssl \
&& mkdir build \
&& cd build \
&& cmake -GNinja .. \