Skip to content

Instantly share code, notes, and snippets.

View diegoachury's full-sized avatar

Diego Fernando Achury diegoachury

View GitHub Profile
@diegoachury
diegoachury / export_node.js
Created January 29, 2024 16:29
a exportar 100,000 registros en lotes de 20,000 utilizando Node.js
const fs = require('fs');
const createCsvWriter = require('csv-writer').createObjectCsvWriter;
// Función simulada para obtener datos (reemplazar con tu lógica de base de datos)
async function obtenerDatos(offset, limit) {
// Aquí iría tu lógica para obtener los datos
// Por ejemplo: SELECT * FROM tu_tabla LIMIT ${limit} OFFSET ${offset}
return []; // Retorna los datos
}
@diegoachury
diegoachury / INSTALL
Created September 8, 2017 14:26 — forked from arya-oss/INSTALL.md
Ubuntu 16.04 Developer Tools installation
###### development tools
sudo apt-get install build-essential python-dev git nodejs-legacy npm gnome-tweak-tool openjdk-8-jdk
### Python packages
sudo apt-get install python-pip python-virtualenv python-numpy python-matplotlib
### pip packages
pip install django flask django-widget-tweaks django-ckeditor beautifulsoup4 requests classifier SymPy ipython
@diegoachury
diegoachury / flash-app.js
Created July 7, 2017 03:09 — forked from brianmacarthur/flash-app.js
Flash messaging in Express 4: express-flash vs. custom middleware in ejs, handlebars, or jade
var express = require('express');
var cookieParser = require('cookie-parser');
var session = require('express-session');
var flash = require('express-flash');
var handlebars = require('express-handlebars')
var app = express();
var sessionStore = new session.MemoryStore;
// View Engines
@diegoachury
diegoachury / index.js
Last active January 31, 2017 23:23
Buscador fulltext mongodb + express
// expressJS route
router.get('/search', function(req, res, next) {
Product.find({ $text: { $search: req.param('title') } } , function(err, docs){
res.render('shop/search', {products: docs} );
});
});
/* Pricing Tables */
.pricing-table {
border: solid 1px #DDDDDD;
margin-left: 0;
margin-bottom: 1.25rem; }
.pricing-table * {
list-style: none;
line-height: 1; }
.pricing-table .title {
background-color: #333333;
@diegoachury
diegoachury / apple-mq.css
Created June 16, 2016 19:26 — forked from AllThingsSmitty/apple-mq.css
iPhone 6/6 Plus and Apple Watch CSS media queries
/* iPhone 6 landscape */
@media only screen and (min-device-width: 375px)
and (max-device-width: 667px)
and (orientation: landscape)
and (-webkit-min-device-pixel-ratio: 2)
{ }
/* iPhone 6 portrait */
@media only screen
and (min-device-width: 375px)
resources :blogs do
resources :articles
end
@diegoachury
diegoachury / Server-express.js
Created April 6, 2016 15:23
servidor express scrap.
"use strict";
var express = require("express"),
exphbs = require('express-handlebars'),
request = require("request"),
cheerio = require("cheerio"),
app = express(),
port = process.env.PORT || 3002;
//array
var urlsArray = ['http://www.lanacion.com.co/', 'http://www.diariodelhuila.com/'];
@diegoachury
diegoachury / UdacityDownload.py
Created February 17, 2016 21:10 — forked from vinovator/UdacityDownload.py
Python program to download course content for multiple Udacity courses neatly arranged within a folder structure
# UdacityDownload.py
# Python 2.7.6
"""
Python script to download course content from udacity courses
- Creates folders as per course names
- Downloads all the zip files
- Extract content from zip file
- Finally delete the zip file
Multiple course content can be downloaded from list
@diegoachury
diegoachury / index.html.erb
Created February 11, 2016 00:16
polymer con RoR
<p id="notice"><%= notice %></p>
<paper-toolbar>
<paper-icon-button icon="menu" on-tap="menuAction"></paper-icon-button>
<div class="title">Listing Ligas</div>
<paper-icon-button icon="more-vert" on-tap="moreAction"></paper-icon-button>
</paper-toolbar>
<table>
<thead>
<tr>