Skip to content

Instantly share code, notes, and snippets.

View Eduardo-Ortega102's full-sized avatar

Eduardo Ortega Naranjo Eduardo-Ortega102

View GitHub Profile
@Eduardo-Ortega102
Eduardo-Ortega102 / copy.py
Created October 31, 2020 09:05
Copy files from drive to colab
from google.colab import drive
drive.mount('/content/drive')
%cp "/content/drive/My Drive/source/models.py" .
%cp "/content/drive/My Drive/source/trainer.py" .
%cp "/content/drive/My Drive/source/experiment.py" .
from os import path
from experiment import Experiment
from models import create_2hidden_layers_model
@Eduardo-Ortega102
Eduardo-Ortega102 / drive.py
Created October 31, 2020 09:02
Connect to Drive from Colab
from google.colab import drive
drive.mount('/content/drive')
@Eduardo-Ortega102
Eduardo-Ortega102 / display_charts.py
Last active October 31, 2020 09:01
17 days running Google Colab
import matplotlib.pyplot as plt
def plot_learning_curve(training_values, validation_values, iteration, file_to_save):
fig, axes = plt.subplots(constrained_layout=True, figsize=(13, 5))
fig.suptitle('Learning Curve Model {}'.format(iteration))
axes.set_ylabel('loss')
axes.set_xlabel('epoch')
axes.plot(training_values, label='train')
axes.plot(validation_values, label='validation')
axes.legend(loc='upper right')
@Eduardo-Ortega102
Eduardo-Ortega102 / example.js
Created October 31, 2020 08:34
Remove Duplicates from an Array with JavaScript
const computers = ['computer1', 'computer2', 'computer3', 'computer2', 'computer1', 'computer3'];
const unique = computers.filter((computer, index) => computers.indexOf(computer) == index);
// Result: ['computer1', 'computer2', 'computer3']
console.log(unique);
@Eduardo-Ortega102
Eduardo-Ortega102 / reading-list.adoc
Created April 25, 2020 11:11 — forked from wwerner/reading-list.adoc
Reading list for young developers
Table of Contents

The Pragmatic Programmer

Straight from the programming trenches, The Pragmatic Programmer: From Journeyman to Master cuts through the increasing specialization and technicalities of modern software development to examine the core process—what do you do, as an individual and as a team, if you want to

@Eduardo-Ortega102
Eduardo-Ortega102 / cisco7decrypt.py
Created December 22, 2018 14:49
A simple utility to decrypt cisco Type 7 passwords
#!/usr/bin/env python3
"""
Based on the documentation from:
- http://pen-testing.sans.org/resources/papers/gcih/cisco-ios-type-7-password-vulnerability-100566
- http://wiki.nil.com/Deobfuscating_Cisco_IOS_Passwords
translation = [
0x64, 0x73, 0x66, 0x64, 0x3b, 0x6b, 0x66, 0x6f, 0x41, 0x2c, 0x2e,
0x69, 0x79, 0x65, 0x77, 0x72, 0x6b, 0x6c, 0x64, 0x4a, 0x4b, 0x44,
public static Historial historial(HttpServletRequest request, Paciente paciente) {
String fecha = new SimpleDateFormat("dd-MM-yyyy").format(new Date());
String notas = request.getParameter("alergiasPaciente");
Integer historialId = generateHistorialId();
return new Historial(historialId, fecha, notas, paciente);
}
@Eduardo-Ortega102
Eduardo-Ortega102 / gist:6a64b863e26002a22b9e8646ec281d67
Last active April 21, 2017 11:25 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote