Skip to content

Instantly share code, notes, and snippets.

View gj1118's full-sized avatar
🦋

Gagan Janjua gj1118

🦋
View GitHub Profile
@gj1118
gj1118 / laravel.js
Last active August 29, 2015 14:27 — forked from soufianeEL/laravel.js
You use Laravel 5 and you want to send a DELETE request without creating a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. To use, import script, and create a link with the `data-method="DELETE"` and `data-token="{{csrf_token()}}"` attributes.
/*
Exemples :
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}">
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}" data-confirm="Are you sure?">
*/
(function() {
@gj1118
gj1118 / 0_reuse_code.js
Created September 30, 2015 20:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console