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 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!');
@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 / 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 / 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 / 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;
}
<?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 / 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() {}
});
@emamut
emamut / data_manipulation_helper.php
Last active August 29, 2015 14:01
Fixture executioner in CI
<?php
if (! function_exists('fixture_executioner'))
{
function fixture_executioner($fixture_path)
{
$ci =& get_instance();
$fixture_restore = $ci->load->file($fixture_path, true);
$fixture_array = explode(';', $fixture_restore);
@emamut
emamut / loading.js
Created May 28, 2014 16:32
Loading modal window
var myApp;
myApp = myApp || (function () {
var pleaseWaitDiv = $('<div class="modal" id="pleaseWaitDialog" data-backdrop="static" data-keyboard="false"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title">Procesando...</h4> </div> <div class="modal-body"> <div class="progress progress-striped active"> <div class="progress-bar" role="progressbar" aria-valuenow="60" aria-valuemax="100" style="width: 100%;"></div> </div> </div> </div> </div> </div>');
return {
showPleaseWait: function() {
pleaseWaitDiv.modal();
},
hidePleaseWait: function () {
pleaseWaitDiv.modal('hide');
},
@emamut
emamut / initializing_jquery_datatables.js
Created June 17, 2014 13:33
Initializing jQuery DataTabless file
$.extend(true, $.fn.dataTable.defaults, {
"bDestroy": false,
"bStateSave": true,
"oLanguage": {
"sLengthMenu": "_MENU_ records per page",
"sProcessing": "Procesando...",
"sLengthMenu": "Mostrar _MENU_ registros",
"sZeroRecords": "No se encontraron resultados",
"sEmptyTable": "Ningún dato disponible en esta tabla",
"sInfo": "Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros",