Skip to content

Instantly share code, notes, and snippets.

View lautenai's full-sized avatar

Lautenai Junior lautenai

View GitHub Profile
@lautenai
lautenai / imap-gmail
Created July 23, 2022 13:57 — 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

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents

@lautenai
lautenai / app.js
Created July 5, 2017 21:40 — forked from duanewilson/app.js
Fix BootStrap3 modal AJAX caching issues when loading remote content. Yes, I know it's deprecated.
$('#myModal').on('loaded.bs.modal', function (e) {
$('#myModal').removeData();
});
$(document).ready(function(){
$('body').on('hidden.bs.modal', '.modal', function () {
$(this).removeData('bs.modal');
});
});
@lautenai
lautenai / compound-interest.js
Created April 22, 2017 17:28 — forked from actuallymentor/compound-interest.js
A simple script to calculate compound interest
// Input it initial amount
// Interest as a number, e.g. 5% is 1.05 on a yearly basis
// Length as number of years
// Name of this calculation
// Addition determines whether the input variable is one time or a yearly contribution
function compound( input, interest, length, name, addition ) {
var accumulated = input
for ( i=0; i < length; i++ ) {
accumulated *= interest
if ( addition ){