Skip to content

Instantly share code, notes, and snippets.

View mrm8488's full-sized avatar
🏠
Working from home

Manuel Romero mrm8488

🏠
Working from home
View GitHub Profile
@mrm8488
mrm8488 / from_kaggle_to_colab.py
Created January 21, 2020 10:35
How to import/download a Kaggle dataset into a Google Colab Notebook
# Easy Steps to persist Kaggle profile by @mrm8488 (Manuel Romero)
# Download kaggle.json from Kaggle -- MyAccount -> Create New API Token -> auto downloads as "kaggle.json
# Import json into notebook - run in a cell
from google.colab import files
files.upload()
# Browse to downloaded kaggle.json and upload
@mrm8488
mrm8488 / express-cache.js
Created January 18, 2020 04:25
Simple Express cache
'use strict'
var express = require('express');
var app = express();
var mcache = require('memory-cache');
app.set('view engine', 'jade');
var cache = (duration) => {
return (req, res, next) => {
#!/bin/sh
set -x
# == Swarm training (alpha release) ==
# Setup:
#
# git clone https://github.com/shawwn/gpt-2
# cd gpt-2
# git checkout dev-shard
@mrm8488
mrm8488 / pdfToMP3.py
Created January 14, 2020 13:48
Convert PDF file to text and then to audio
import pdftotext
from gtts import gTTS
from sys import argv
with open(argv[1], "rb") as f:
pdf = pdftotext.PDF(f)
document= "\n\n".join(pdf)
tts = gTTS(document)
print("Saving Audio file")
tts.save(argv[1]+".mp3")
export default function generateSocialImage({
title,
tagline,
+ cloudName,
+ imagePublicID,
+ cloudinaryUrlBase = 'https://res.cloudinary.com',
+ version = null,
titleFont = 'arial',
titleExtraConfig = '',
taglineExtraConfig = '',
@mrm8488
mrm8488 / Info-commands.sh
Created January 7, 2020 04:21
Commands to obtain all interesting info of a machine
printenv
ifconfig -a
iptable -L
cat /etc/apache2/site-enabled/*
netstat -punta
@mrm8488
mrm8488 / vector_matrix.js
Created January 3, 2020 21:49
Create a vector and a matrix in JS
const array = (size,value = 0) => Array(size).fill(value);
let a = array(n);
const matrix = (rows,cols,value = 0) => Array(rows).fill(Array(cols).fill(value));
let m = matrix(r,c);
@mrm8488
mrm8488 / an-inquiry-into-matplotlib-figures.ipynb
Created December 23, 2019 20:55 — forked from akashpalrecha/an-inquiry-into-matplotlib-figures.ipynb
This notebook dives deep into Matplotlib's Figures, Axes, subplots and the very amazing GridSpec!
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<html>
<head>
<style>
body {
margin: 0;
height: 100vh;
width: 100vw;
}
</style>
// Node.js readline & async iteration:
const fs = require('fs");
const {createlnterface: ci} =
require('readline’);
async function logLines(ls) {
for await (const l of ls) {
console.log('>"' + l);