Skip to content

Instantly share code, notes, and snippets.

View bgdos's full-sized avatar

Juan Salgado bgdos

  • Poly Material Mexico
  • Tecate, Mexico
View GitHub Profile
@bgdos
bgdos / export-html-table-to-excel.md
Created September 13, 2017 15:28 — forked from umidjons/export-html-table-to-excel.md
Export HTML table to Excel in AngularJS

Export HTML table to Excel in AngularJS

myApp.factory('Excel',function($window){
		var uri='data:application/vnd.ms-excel;base64,',
			template='<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>',
			base64=function(s){return $window.btoa(unescape(encodeURIComponent(s)));},
			format=function(s,c){return s.replace(/{(\w+)}/g,function(m,p){return c[p];})};
		return {
@bgdos
bgdos / insertar.sql
Created October 7, 2015 14:35 — forked from marcomarkkez/insertar.sql
ejemplo de store procedure dinamica en mysql para insertar
DELIMITER $$
DROP PROCEDURE IF EXISTS Insertar $$
CREATE PROCEDURE Insertar(
IN tipo INT,
IN tablas VARCHAR(1000),
IN columnas VARCHAR(1000),
IN inserciones VARCHAR(1000)
)
BEGIN