Skip to content

Instantly share code, notes, and snippets.

View a2sc's full-sized avatar

Amaury de Saint Chamas a2sc

  • a2sc
  • France
  • 00:00 (UTC +02:00)
View GitHub Profile
@a2sc
a2sc / how-to-restore-from-your-local-repository-an-accidentaly-deleted-remote-repository-on-github.md
Created May 6, 2024 01:16
Github Desktop App: How to restore from your local repository an accidentaly deleted remote repository on Github

If you accidentally delete your remote repository on Github, which is really stupid, but it happened to me once, despite the requested confirmations... you will have errors when trying to push from the Github Desktop App!

Here is the very simple procedure to follow:

  1. Create a new repository on Github from your account with the same name as your previous repository. IMPORTANT: Make sure to not initialize the repository with a README, .gitignore, or license since you already have files locally that you want to push.

  2. In the terminal, navigate to your local repository's directory:

git remote set-url origin https://github.com/your-username/your-repository.git
@a2sc
a2sc / fix-errors-with-require-in-es6-in-cypress-config-js-laracasts-cypress3-laravel11-inertia-and-jetstream-vue-vite.md
Created May 5, 2024 16:26
Fix errors with require in es6 in cypress.config.js (Using: Laracasts/Cypress 3 + Laravel 11 + Inertia and Jetstream + Vue + Vite)

Lines to modify in the cypress.config.js file

import { defineConfig } from 'cypress'
import index from './tests/cypress/plugins/index.js'

export default defineConfig({

    //...
    
@a2sc
a2sc / css-pseudo-classes-is-and-where.html
Created March 18, 2024 11:02
CSS Pseudo Classes :is and :where
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>CSS Pseudo Classes :is and :where</title>
<style>
/* OLD CSS
header p:hover,
@a2sc
a2sc / css-pseudo-element-marker.html
Created March 18, 2024 10:24
CSS Pseudo Element ::marker
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style>
.test-1 li::marker {
color: red;
}
@a2sc
a2sc / css-only-radial-progress-bars.html
Created March 18, 2024 10:22
CSS-Only Radial Progress Bars
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>CSS-Only Radial Progress Bars/title>
<style>
.progress {
width: 100px;
@a2sc
a2sc / mime-types-to-extension-mapping.php
Created May 1, 2023 17:23
PHP array version of the mapping of Internet media types (mime-type) to unique file extension(s)
<?php
/**
* PHP array version of the mapping of Internet media types to unique file extension(s)
*
* The original file is from:
* https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
*
* This file maps Internet media types to unique file extension(s).
* Although created for httpd, this file is used by many software systems
@a2sc
a2sc / Laravel_Collection_tips.md
Last active November 21, 2019 04:08
Laravel Collection tips

Laravel Collection tips

Pluck method

Using dot notation and wildcard:

Example #1

$posts = collect([