Skip to content

Instantly share code, notes, and snippets.

View emamut's full-sized avatar
💭
💎Harder. 🏆Better. ⚡Faster. 💪🏾Stronger

Faber Andrés Vergara Holguín emamut

💭
💎Harder. 🏆Better. ⚡Faster. 💪🏾Stronger
View GitHub Profile
@emamut
emamut / foo.js
Created May 19, 2014 13:35
How to show loading spinner in jQuery?
jQuery.ajaxSetup({
beforeSend: function() {
$('#loader').show();
},
complete: function(){
$('#loader').hide();
},
success: function() {}
});
<?php
/**
* base include file for SimpleTest
* @package SimpleTest
* @subpackage UnitTester
* @version $Id: dumper.php 1909 2009-07-29 15:58:11Z dgheath $
*/
/**
* Parses the command line arguments.
@emamut
emamut / custom.css
Created April 22, 2014 15:08
Stackoverflow answer: Export to CSV using jQuery and html
a.export, a.export:visited {
text-decoration: none;
color:#000;
background-color:#ddd;
border: 1px solid #ccc;
padding:8px;
}
@emamut
emamut / index.html
Last active September 6, 2021 09:33
Export JSON array to MS Excel
<script type='text/javascript' src='script.js'></script>
<a id="test" href="">Test.xls</a>
@emamut
emamut / ajax_request.js
Created April 8, 2014 20:05
Ajax request function
function ajax_request(url, data, name) {
$.ajax({
url: site_url + url,
type: 'POST',
data: {id: data},
})
.done(function(response) {
$('.modal-body').empty();
$('.modal-title').empty();
@emamut
emamut / get_actual_date.js
Created April 8, 2014 20:04
get actual date
function get_actual_date () {
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth() + 1;
var yyyy = today.getFullYear();
if(dd < 10)
dd = '0' + dd
if(mm < 10)
@emamut
emamut / foo.js
Created March 26, 2014 15:54
Getting all selected checkboxes in an array
$('#process').on('click', function(){
var checkboxs_checked = [];
$("input:checkbox:checked").each(function() {
checkboxs_checked.push($(this).val());
});
console.log(checkboxs_checked);
if(checkboxs_checked.length == 0)
alert('Seleccione al menos una hora extra para procesar!');