Skip to content

Instantly share code, notes, and snippets.

View Nora1Meziani's full-sized avatar

Nora Mez Nora1Meziani

View GitHub Profile
@ryanpadilha
ryanpadilha / fix-apt-get.sh
Last active September 18, 2025 14:25
Commands to fix apt - E: Sub-process /usr/bin/dpkg returned an error code (1)
#!/bin/bash
sudo rm -rf /var/lib/dpkg/info/*.*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get update
sudo apt-get check
sudo apt-get -f install
sudo apt-get upgrade
@joelrojo
joelrojo / ajax_cheat_sheet.md
Last active August 5, 2024 11:56
AJAX 101 cheat sheet

#AJAX

What is AJAX

"AJAX an acronym for asynchronous JavaScript and XML is a group of interrelated web development techniques used on the client-side to create asynchronous web applications. With Ajax, web applications can send data to, and retrieve data from, a server asynchronously (in the background) without interfering with the display and behavior of the existing page. Data can be retrieved using the XMLHttpRequest object. Despite the name, the use of XML is not required (JSON is often used instead), and the requests do not need to be asynchronous." - wikipedia

AJAX with jQuery

jQuery provides a $.ajax() method with a set of options for sending requests and callback methods to handle responses.

  • Here is the most basic $.ajax() request that does not send any data. It will be handled by the post '/trips' route on the server. You can choose any of the http request verbs for the type parameter (get, post, put, delete)