Skip to content

Instantly share code, notes, and snippets.

View audreybula's full-sized avatar

Olivia Bula audreybula

View GitHub Profile
@audreybula
audreybula / ajax-modal-content.js
Created March 14, 2021 09:48 — forked from mattrothstein/ajax-modal-content.js
This is a way to load ajax content in a materialize modal
$(document).ready(function(){
// the "href" attribute of .modal-trigger must specify the modal ID that wants to be triggered
// the "data-source" attribute of .modal-trigger must specify the url that will be ajaxed
$('.modal-trigger').click(function(){
var url = $('.modal-trigger').attr("data-source");
// use other ajax submission type for post, put ...
$.get( url, function( data ) {
// use this method you need to handle the response from the view
// with rails Server-Generated JavaScript Responses this is portion will be in a .js.erb file
$( ".modal-content" ).html(data);
@audreybula
audreybula / imap-gmail
Created March 2, 2021 03:40 — forked from aikchun/imap-gmail
IMAP PHP gmail attachment extractor
<?php
/**
*
* Gmail attachment extractor.
*
* Downloads attachments from Gmail and saves it to a file.
* Uses PHP IMAP extension, so make sure it is enabled in your php.ini,
* extension=php_imap.dll