Skip to content

Instantly share code, notes, and snippets.

View ousid's full-sized avatar
🔥
Building Livewire Toolkit

Oussama ousid

🔥
Building Livewire Toolkit
View GitHub Profile
@ousid
ousid / revert-a-commit.md
Created October 20, 2022 15:42 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@ousid
ousid / _virtual-select.scss
Last active November 14, 2021 14:21
Laravel Searchable Dropdown Component
// custom style using sass & tailwindcss
.vscomp-ele {
max-width: 100% !important;
.vscomp-toggle-button {
@apply mt-1 border-gray-300 transition block w-full duration-150 rounded-md shadow-inner bg-gray-100 py-3;
&:focus {
@apply border border-info ring-info ring-opacity-25;
@ousid
ousid / UsersComponent.php
Last active April 19, 2022 15:35
Livewire Example Using Virtual Select (Alternative to Select2)
<?php
// ....
/** @var array */
public $selectedUsers;
public function create()
{
// selectedUsers returns an array of ids.
@ousid
ousid / app.scss
Last active October 9, 2020 18:29
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@200;300;400;600;700;900&display=swap');
@import './switch';
@tailwind base;
:root {
color-scheme: light dark;
}