Cambiado de laravel a flask

Todo es mas simple~
This commit is contained in:
Daniel Cortes
2020-05-22 01:57:45 -04:00
parent 06dcd5405e
commit 47df38c768
1193 changed files with 171748 additions and 27883 deletions

25
src/about.md Executable file
View File

@@ -0,0 +1,25 @@
# About
Hola!, soy un estudiante de ingeniería en informática al que le gusta programar,
jugar videojuegos cuando se puede y escuchar música, mucha, mucha música.
Me gusta aprender nuevos lenguajes de programación pero generalmente estoy seco
de ideas con lo que me cuesta bastante avanzar en lenguajes como C y C++, en los
que simplemente no se hacer.
Este blog lo cree principalmente porque quería un proyecto secundario en el que
trabajar, que no tuviera tanta importancia y lo hiciera de relax, la idea es
publicar snipets de código que generalmente se me olvidan y siempre estoy
volviendo a ellos, si en algún momento me emociono quizás publico algo
totalmente distinto.
Para ver los proyectos que he hecho puedes verlos entre
[Github](https://github.com/Ryuuji159) y [Source Hut](https://git.sr.ht/~skrd159).
Socialmente me muevo entre [Twitter](https://twitter.com/skrd159) y
[Reddit](https://www.reddit.com/user/Ryuuji159) aunque estoy intentando dejar
las redes sociales como ya lo hice con Facebook.
Finalmente, si quieres enviarme un correo mi dirección es daniel.cortes.p159@gmail.com
*Gracias por venir aquí.*

4
src/assets/codehilite.css Executable file
View File

@@ -0,0 +1,4 @@
/******************************************************************************
=> CODEHILITE
*******************************************************************************/
.codehilite .hll{background-color:#f1fa8c}.codehilite{background:#282a36;color:#f8f8f2}.codehilite .c{color:#6272a4}.codehilite .err,.codehilite .g{color:#f8f8f2}.codehilite .k{color:#ff79c6}.codehilite .l,.codehilite .n{color:#f8f8f2}.codehilite .o{color:#ff79c6}.codehilite .p,.codehilite .x{color:#f8f8f2}.codehilite .ch,.codehilite .cm{color:#6272a4}.codehilite .cp{color:#ff79c6}.codehilite .c1,.codehilite .cpf,.codehilite .cs{color:#6272a4}.codehilite .gd{color:#8b080b}.codehilite .ge{color:#f8f8f2;text-decoration:underline}.codehilite .gr{color:#f8f8f2}.codehilite .gh,.codehilite .gi{color:#f8f8f2;font-weight:700}.codehilite .go{color:#44475a}.codehilite .gp,.codehilite .gs,.codehilite .gt{color:#f8f8f2}.codehilite .gu{color:#f8f8f2;font-weight:700}.codehilite .kc{color:#ff79c6}.codehilite .kd{color:#8be9fd;font-style:italic}.codehilite .kn,.codehilite .kp,.codehilite .kr{color:#ff79c6}.codehilite .kt{color:#8be9fd}.codehilite .ld{color:#f8f8f2}.codehilite .m{color:#bd93f9}.codehilite .s{color:#f1fa8c}.codehilite .na{color:#50fa7b}.codehilite .nb{color:#8be9fd;font-style:italic}.codehilite .nc{color:#50fa7b}.codehilite .nd,.codehilite .ne,.codehilite .ni,.codehilite .no{color:#f8f8f2}.codehilite .nf{color:#50fa7b}.codehilite .nl{color:#8be9fd;font-style:italic}.codehilite .nn,.codehilite .nx,.codehilite .py{color:#f8f8f2}.codehilite .nt{color:#ff79c6}.codehilite .nv{color:#8be9fd;font-style:italic}.codehilite .ow{color:#ff79c6}.codehilite .w{color:#f8f8f2}.codehilite .mb,.codehilite .mf,.codehilite .mh,.codehilite .mi,.codehilite .mo{color:#bd93f9}.codehilite .dl,.codehilite .s1,.codehilite .s2,.codehilite .sa,.codehilite .sb,.codehilite .sc,.codehilite .sd,.codehilite .se,.codehilite .sh,.codehilite .si,.codehilite .sr,.codehilite .ss,.codehilite .sx{color:#f1fa8c}.codehilite .bp{color:#f8f8f2;font-style:italic}.codehilite .fm{color:#50fa7b}.codehilite .vc,.codehilite .vg,.codehilite .vi,.codehilite .vm{color:#8be9fd;font-style:italic}.codehilite .il{color:#bd93f9}

9
src/assets/fonts.css Executable file
View File

@@ -0,0 +1,9 @@
/******************************************************************************
=> FONTS
*******************************************************************************/
@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:400;src:local('Source Code Pro'),url(https://static.danielcortes.xyz/fonts/SourceCodePro/SourceCodePro-Regular.woff2) format('woff2');font-display:swap}
@font-face{font-family:'Source Code Pro';font-style:normal;font-weight:700;src:local('Source Code Pro'),url(https://static.danielcortes.xyz/fonts/SourceCodePro/SourceCodePro-Bold.woff2) format('woff2');font-display:swap}
@font-face{font-family:'Source Serif Pro';font-style:normal;font-weight:400;src:local('Source Serif Pro'),url(https://static.danielcortes.xyz/fonts/SourceSerifPro/SourceSerifPro-Regular.woff2) format('woff2')}
@font-face{font-family:'Source Serif Pro';font-style:normal;font-weight:700;src:local('Source Serif Pro'),url(https://static.danielcortes.xyz/fonts/SourceSerifPro/SourceSerifPro-Bold.woff2) format('woff2');font-display:swap}
@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:400;src:local('Source Sans Pro'),url(https://static.danielcortes.xyz/fonts/SourceSansPro/SourceSansPro-Regular.woff2) format('woff2');font-display:swap}
@font-face{font-family:'Source Sans Pro';font-style:normal;font-weight:700;src:local('Source Sans Pro'),url(https://static.danielcortes.xyz/fonts/SourceSansPro/SourceSansPro-Bold.woff2) format('woff2');font-display:swap}

4
src/assets/normalize.css vendored Executable file
View File

@@ -0,0 +1,4 @@
/******************************************************************************
=> NORMALIZE.CSS
*******************************************************************************/
button,hr,input{overflow:visible}progress,sub,sup{vertical-align:baseline}[type=checkbox],[type=radio],legend{box-sizing:border-box;padding:0}html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}details,main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:ButtonText dotted 1px}fieldset{padding:.35em .75em .625em}legend{color:inherit;display:table;max-width:100%;white-space:normal}textarea{overflow:auto}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}[hidden],template{display:none}

75
src/assets/style.css Executable file
View File

@@ -0,0 +1,75 @@
/******************************************************************************
=> MAIN STYLES
*******************************************************************************/
:root{
--background-color: hsl(10, 20%, 98%);
--foreground-color: hsl(10, 10%, 13%);
--primary-color: hsl(200, 90%, 40%);
--highlight-color: hsl(290, 86%, 43%);
--light-color: hsl(10, 10%, 40%);
}
body {
background-color: var(--background-color);
color: var(--foreground-color);
overflow-y: scroll;
font-family: Source Sans Pro;
font-size: 1em;
}
@media only screen and (max-width: 800px) {
body {
font-size: 1em;
}
}
.container {
max-width: 80ch;
padding: 2em 0;
margin: auto;
}
h1 {
margin: 0;
}
time {
color: var(--light-color);
}
p {
line-height: 1.5em;
text-align: justify;
}
a, a:visited {
color: var(--highlight-color);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
img {
max-width: 100%;
cursor: pointer;
}
code {
font-family: Source Code Pro;
font-size: 1em;
}
.codehilite {
border: none;
border-radius: 5px;
overflow-x: auto;
}
.codehilite pre {
margin: 1em;
}

View File

@@ -0,0 +1,95 @@
# Una mejor forma para contar utilizando HashMaps en Java
<time datetime="2019-10-17"> Oct 17, 2019 </time>
Este es un problema muy común y se presenta regularmente en multiples
situaciones, tienes una lista de cosas que se repiten y tienes que contar sus
ocurrencias, o tal vez necesitas contar los largos de una lista de palabras,
etc (ahora no se me ocurren mas).
Previo a Java 8, la única forma (que a mi se me ocurra al menos) de hacer esto
era así:
:::java
String[] things = {
"ball", "celery", "hand", "celery",
"mind", "ball", "fresh", "hand", "ball",
"fresh", "fresh"
};
Map<String, Integer> oldWay = new HashMap<>();
for (String thing : things) {
if (oldWay.containsKey(thing)) {
oldWay.put(thing, oldWay.get(thing) + 1);
} else {
oldWay.put(thing, 1);
}
}
System.out.println("ball => " + oldWay.get("ball"));
System.out.println("celery => " + oldWay.get("celery"));
System.out.println("hand => " + oldWay.get("hand"));
System.out.println("fresh => " + oldWay.get("fresh"));
System.out.println("mind => " + oldWay.get("mind"));
Lo cual resulta en:
:::md
ball => 3
celery => 2
hand => 2
fresh => 3
mind => 1
Este es el código que utilizaba siempre cuando estaba aprendiendo Java, pero
es realmente confuso cuando estas empezando, al menos yo tuve muchos problemas
con nulls porque no entendía realmente que estaba haciendo.
Primero tenemos que comprobar si el elemento existe, si existe debemos
obtenerlo para sumarlo y agregarlo al `HashMap`, y cuando no existe, se coloca
la key con el valor por default, en este caso 1.
Pero este código puede ser mas corto y claro desde la llegada de Java 8 y
actualmente estamos en Java 13 así que no hay escusa, ahora tenemos Lambdas y
`HashMap` recibió nuevas funciones, entre ellas las que se usaran aquí,
`putIfAbsent()` y `computeIfPresent()`:
:::java
for (String thing : things) {
eightWay.putIfAbsent(thing, 0);
eightWay.computeIfPresent(thing, (key, value) -> value + 1);
}
`pufIfAbsent()` agrega una key solamente si no existe previamente y
`computeIfPresent()` calcula el nuevo valor que contendrá la key con el
lambda que se entrega en el segundo argumento, como los 2 serán ejecutados si
es que el elemento no existe en el `HashMap`, se empieza a contar desde 0.
Pero tenemos una función que es mas concisa y al menos a mi me agrada mas para
solucionar este problema, esta se llama `merge()`:
:::java
for (String thing : things) {
betterWay.merge(thing, 1, (oldValue, newValue) -> oldValue + newValue);
}
`merge()` toma por argumentos, la key que se agregara, el valor que se quiere
agregar y un lambda que ejecutar si es ya existía la key, en el se podrá
calcular el nuevo valor que en este caso suma el valor antiguo con el valor
que se quiere agregar.
Incluso esta forma puede quedar aun mas corta si se utiliza una referencia de
método, en ingles: method reference, que suena bastante mejor a mi gusto:
:::java
for (String thing : things) {
evenBetterWay.merge(thing, 1, Integer::sum);
}
Y esa seria una mejor forma de contar con `HashMaps`, no es que sea
necesariamente mas rápido, de hecho ni siquiera he testeado su velocidad, pero
el código queda mucho mas corto y claro, ademas, siempre se me olvida como se
hace, así que ahora quedara escrito aquí para que mi futuro yo lo pueda
recordar.

5
src/blog/index.md Executable file
View File

@@ -0,0 +1,5 @@
#Blog
- [Cosas que olvido sobre SQL](/blog/olvido_sobre_sql.html)
- [Comandos de git que olvido constantemente](/blog/olvido_sobre_git.html)
- [Una mejor forma para contar utilizando HashMaps en Java](/blog/contar_con_hashmaps_java.html)

35
src/blog/olvido_sobre_git.md Executable file
View File

@@ -0,0 +1,35 @@
# Comandos de git que olvido constantemente
<time datetime="2019-10-23">Oct 23, 2019</time>
Aquí ire dejando multiples comandos de git que he estado buscando muchas veces y siempre vuelvo a olvidar
### 1 - Sacar archivo o carpeta de la zona de stage
:::bash
git reset HEAD -- <archivo/carpeta>
### 2 - Deshacer ultimo commit
:::bash
git reset --soft HEAD~1
### 3 - Cambiar el nombre de una annotated tag
:::bash
git tag <new> <old> -f -a
### 4 - Deshabilitar fast forward por default
:::bash
git config --global merge.ff false
### 5 - Siempre firmar commits
:::bash
git config --global commit.gpgsign true
### 6 - Siempre mostrar diff en commit
:::bash
git config --global commit.verbose true
### 7 - Push tags
:::bash
git push --tags
Esta lista ira creciendo a medida que valla necesitando nuevos comandos :3

70
src/blog/olvido_sobre_sql.md Executable file
View File

@@ -0,0 +1,70 @@
# Cosas que olvido sobre SQL
<time datetime="2019-10-23"> Oct 23, 2019 </time>
Si bien considero saber usar SQL al nivel suficiente con el cual hacer una
aplicación simple, al menos nunca me he visto en la necesidad de ir mas allá de
hacer un left join, siempre olvido su sintaxis, por eso aquí mantendré una lista
de comandos que uso constantemente.
Todos los datos son basados en MySQL, que es la base de datos que mas utilizo.
## 1 - Crear tabla
:::sql
create table usuario
(
id int primary key auto_increment,
nombre varchar(255) not null,
password binary(32) not null,
salt binary(16) not null,
trabajador int not null,
foreign key (trabajador) references trabajador (id),
inserted_at timestamp,
modified_at timestamp,
);
## 2 - Como usar on delete y on update
Cuando se crean foreign keys se tiene la opción de agregar on delete y on update
constraints, siempre olvido exactamente que significa cada modo de estos
constraints así que para ilustrarlos usare el siguiente modelo:
:::sql
create table trabajador
(
id int primary,
nombre varchar(255) not null
);
create table usuario
(
id int primary key,
nombre varchar(255) not null,
trabajador_id int not null,
foreign key (trabajador_id) references trabajador on (id)
);
### `ON UPDATE`
- `RESTRICT` (default): Si es que se intenta actualizar el id de la tabla
trabajador la operación sera rechazada mientras exista al menos un usuario
que referencie a ese trabajador.
- `NO ACTION`: Lo mismo que `RESTRICT`.
- `CASCADE`: Si es que se intenta actualizar el id del trabajador, el id
también sera actualizado en todos los usuarios que referencien al
trabajador.
- `SET NULL`: Al cambiar el id del trabajador, las referencias a este id en
la tabla usuario se harán nulas.
### `ON DELETE`
- `RESTRICT` (default): Si es que se intenta eliminar el trabajador la
operación sera rechazada mientras exista al menos un usuario que tenga una
referencia a ese trabajador.
- `NO ACTION`: Lo mismo que `RESTRICT`.
- `CASCADE`: Al eliminar un trabajador también se eliminaran todos los
usuarios que tengan su id asociado.
- `SET NULL`: Cuando se elimine un trabajador, todas sus referencias en la
tabla usuarios sera llenadas con nulls.
## 3 - Creación de foreign keys fuera del create table
:::sql
alter table usuario add constraint fk_usuario_trabajador
foreign key (trabajador_id) references trabajador (id);

77
src/codehilite.css Executable file
View File

@@ -0,0 +1,77 @@
.codehilite .hll { background-color: #f1fa8c }
.codehilite { background: #282a36; color: #f8f8f2 }
.codehilite .c { color: #6272a4 } /* Comment */
.codehilite .err { color: #f8f8f2 } /* Error */
.codehilite .g { color: #f8f8f2 } /* Generic */
.codehilite .k { color: #ff79c6 } /* Keyword */
.codehilite .l { color: #f8f8f2 } /* Literal */
.codehilite .n { color: #f8f8f2 } /* Name */
.codehilite .o { color: #ff79c6 } /* Operator */
.codehilite .x { color: #f8f8f2 } /* Other */
.codehilite .p { color: #f8f8f2 } /* Punctuation */
.codehilite .ch { color: #6272a4 } /* Comment.Hashbang */
.codehilite .cm { color: #6272a4 } /* Comment.Multiline */
.codehilite .cp { color: #ff79c6 } /* Comment.Preproc */
.codehilite .cpf { color: #6272a4 } /* Comment.PreprocFile */
.codehilite .c1 { color: #6272a4 } /* Comment.Single */
.codehilite .cs { color: #6272a4 } /* Comment.Special */
.codehilite .gd { color: #8b080b } /* Generic.Deleted */
.codehilite .ge { color: #f8f8f2; text-decoration: underline } /* Generic.Emph */
.codehilite .gr { color: #f8f8f2 } /* Generic.Error */
.codehilite .gh { color: #f8f8f2; font-weight: bold } /* Generic.Heading */
.codehilite .gi { color: #f8f8f2; font-weight: bold } /* Generic.Inserted */
.codehilite .go { color: #44475a } /* Generic.Output */
.codehilite .gp { color: #f8f8f2 } /* Generic.Prompt */
.codehilite .gs { color: #f8f8f2 } /* Generic.Strong */
.codehilite .gu { color: #f8f8f2; font-weight: bold } /* Generic.Subheading */
.codehilite .gt { color: #f8f8f2 } /* Generic.Traceback */
.codehilite .kc { color: #ff79c6 } /* Keyword.Constant */
.codehilite .kd { color: #8be9fd; font-style: italic } /* Keyword.Declaration */
.codehilite .kn { color: #ff79c6 } /* Keyword.Namespace */
.codehilite .kp { color: #ff79c6 } /* Keyword.Pseudo */
.codehilite .kr { color: #ff79c6 } /* Keyword.Reserved */
.codehilite .kt { color: #8be9fd } /* Keyword.Type */
.codehilite .ld { color: #f8f8f2 } /* Literal.Date */
.codehilite .m { color: #bd93f9 } /* Literal.Number */
.codehilite .s { color: #f1fa8c } /* Literal.String */
.codehilite .na { color: #50fa7b } /* Name.Attribute */
.codehilite .nb { color: #8be9fd; font-style: italic } /* Name.Builtin */
.codehilite .nc { color: #50fa7b } /* Name.Class */
.codehilite .no { color: #f8f8f2 } /* Name.Constant */
.codehilite .nd { color: #f8f8f2 } /* Name.Decorator */
.codehilite .ni { color: #f8f8f2 } /* Name.Entity */
.codehilite .ne { color: #f8f8f2 } /* Name.Exception */
.codehilite .nf { color: #50fa7b } /* Name.Function */
.codehilite .nl { color: #8be9fd; font-style: italic } /* Name.Label */
.codehilite .nn { color: #f8f8f2 } /* Name.Namespace */
.codehilite .nx { color: #f8f8f2 } /* Name.Other */
.codehilite .py { color: #f8f8f2 } /* Name.Property */
.codehilite .nt { color: #ff79c6 } /* Name.Tag */
.codehilite .nv { color: #8be9fd; font-style: italic } /* Name.Variable */
.codehilite .ow { color: #ff79c6 } /* Operator.Word */
.codehilite .w { color: #f8f8f2 } /* Text.Whitespace */
.codehilite .mb { color: #bd93f9 } /* Literal.Number.Bin */
.codehilite .mf { color: #bd93f9 } /* Literal.Number.Float */
.codehilite .mh { color: #bd93f9 } /* Literal.Number.Hex */
.codehilite .mi { color: #bd93f9 } /* Literal.Number.Integer */
.codehilite .mo { color: #bd93f9 } /* Literal.Number.Oct */
.codehilite .sa { color: #f1fa8c } /* Literal.String.Affix */
.codehilite .sb { color: #f1fa8c } /* Literal.String.Backtick */
.codehilite .sc { color: #f1fa8c } /* Literal.String.Char */
.codehilite .dl { color: #f1fa8c } /* Literal.String.Delimiter */
.codehilite .sd { color: #f1fa8c } /* Literal.String.Doc */
.codehilite .s2 { color: #f1fa8c } /* Literal.String.Double */
.codehilite .se { color: #f1fa8c } /* Literal.String.Escape */
.codehilite .sh { color: #f1fa8c } /* Literal.String.Heredoc */
.codehilite .si { color: #f1fa8c } /* Literal.String.Interpol */
.codehilite .sx { color: #f1fa8c } /* Literal.String.Other */
.codehilite .sr { color: #f1fa8c } /* Literal.String.Regex */
.codehilite .s1 { color: #f1fa8c } /* Literal.String.Single */
.codehilite .ss { color: #f1fa8c } /* Literal.String.Symbol */
.codehilite .bp { color: #f8f8f2; font-style: italic } /* Name.Builtin.Pseudo */
.codehilite .fm { color: #50fa7b } /* Name.Function.Magic */
.codehilite .vc { color: #8be9fd; font-style: italic } /* Name.Variable.Class */
.codehilite .vg { color: #8be9fd; font-style: italic } /* Name.Variable.Global */
.codehilite .vi { color: #8be9fd; font-style: italic } /* Name.Variable.Instance */
.codehilite .vm { color: #8be9fd; font-style: italic } /* Name.Variable.Magic */
.codehilite .il { color: #bd93f9 } /* Literal.Number.Integer.Long */

52
src/fonts.css Executable file
View File

@@ -0,0 +1,52 @@
/******************************************************************************
=> Fonts
*******************************************************************************/
/******************************************************************************
=> Source Code Pro
*******************************************************************************/
@font-face {
font-family: 'Source Code Pro';
font-style: normal;
font-weight: 400;
src: local('Source Code Pro'), url('https://static.danielcortes.xyz/fonts/SourceCodePro/SourceCodePro-Regular.ttf') format('truetype');
}
@font-face {
font-family: 'Source Code Pro';
font-style: normal;
font-weight: 700;
src: local('Source Code Pro'), url('https://static.danielcortes.xyz/fonts/SourceCodePro/SourceCodePro-Bold.ttf') format('truetype');
}
/******************************************************************************
=> Source Serif Pro
*******************************************************************************/
@font-face {
font-family: 'Source Serif Pro';
font-style: normal;
font-weight: 400;
src: local('Source Serif Pro'), url('https://static.danielcortes.xyz/fonts/SourceSerifPro/SourceSerifPro-Regular.ttf') format('truetype');
}
@font-face {
font-family: 'Source Serif Pro';
font-style: normal;
font-weight: 700;
src: local('Source Serif Pro'), url('https://static.danielcortes.xyz/fonts/SourceSerifPro/SourceSerifPro-Bold.ttf') format('truetype');
}
/******************************************************************************
=> Source Sans Pro
*******************************************************************************/
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro'), url('https://static.danielcortes.xyz/fonts/SourceSansPro/SourceSansPro-Regular.ttf') format('truetype');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 700;
src: local('Source Sans Pro'), url('https://static.danielcortes.xyz/fonts/SourceSansPro/SourceSansPro-Bold.ttf') format('truetype');
}

8
src/index.md Executable file
View File

@@ -0,0 +1,8 @@
#Daniel Cortes
- [Blog](/blog)
- [Now](/now.html)
- [Projects](/projects.html)
- [Setup](/setup.html)
- [Random](/random.html)
- [About](/about.html)

349
src/normalize.css vendored Executable file
View File

@@ -0,0 +1,349 @@
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
html {
line-height: 1.15; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers.
*/
body {
margin: 0;
}
/**
* Render the `main` element consistently in IE.
*/
main {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
overflow: visible; /* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* Remove the gray background on active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Remove the border on images inside links in IE 10.
*/
img {
border-style: none;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
margin: 0; /* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input { /* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select { /* 1 */
text-transform: none;
}
/**
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Correct the padding in Firefox.
*/
fieldset {
padding: 0.35em 0.75em 0.625em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box; /* 1 */
color: inherit; /* 2 */
display: table; /* 1 */
max-width: 100%; /* 1 */
padding: 0; /* 3 */
white-space: normal; /* 1 */
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Remove the default vertical scrollbar in IE 10+.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
/**
* Remove the inner padding in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
font: inherit; /* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Misc
========================================================================== */
/**
* Add the correct display in IE 10+.
*/
template {
display: none;
}
/**
* Add the correct display in IE 10.
*/
[hidden] {
display: none;
}

3
src/now.md Executable file
View File

@@ -0,0 +1,3 @@
#Now
(En Construccion!)

3
src/projects.md Executable file
View File

@@ -0,0 +1,3 @@
# Projects
(En Construccion!)

20
src/random.md Executable file
View File

@@ -0,0 +1,20 @@
#Random Stuff
Por aqui dejare links a cosas random que son interesantes, o me gustan, o simplemente quiero guardar
## Preguntas / Respuestas en StackOverflow
- [SQL select only rows with max value on a column](https://stackoverflow.com/questions/7745609/sql-select-only-rows-with-max-value-on-a-column)
- [Set of unambiguous looking letters & numbers for user input](https://stackoverflow.com/questions/11919708/set-of-unambiguous-looking-letters-numbers-for-user-input)
## Blog posts de otros
- [Bimodal programming why design patterns fail](https://blog.cerebralab.com/Bimodal_programming_%E2%80%93_why_design_patterns_fail)
- [An app can be a home-cooked meal](https://www.robinsloan.com/notes/home-cooked-app/)
- [The Decline of Usability](https://datagubbe.se/decusab/)
- [The Original Cookie specification from 1997 was GDPR compliant](https://baekdal.com/thoughts/the-original-cookie-specification-from-1997-was-gdpr-compliant/)
## Recursos
- [Wcode - Usar palabras para transmitir codigos de uso humano](https://wcodes.org/)
## Videos
- [Jack Diederich - Stop Writing Classes](https://www.youtube.com/watch?v=o9pEzgHorH0)

9
src/script.js Executable file
View File

@@ -0,0 +1,9 @@
function makeImagesClickeable() {
document.querySelectorAll("img").forEach(img => {
img.addEventListener("click", e => window.open(e.target.src))
});
}
window.addEventListener('DOMContentLoaded', (event) => {
makeImagesClickeable();
});

136
src/setup.md Executable file
View File

@@ -0,0 +1,136 @@
#Setup
<time datetime="2020-04-07"> Abr 7, 2020 </time>
![Screenshot de mi setup](https://static.danielcortes.xyz/images/1586308490.png)
Actualmente el setup que estoy usando a cambiado, ya no puedo utilizar un tiling window manager como `herbstluftwm`, porque estoy obligado a usar VirtualBox para poder correr Microsoft Teams, que es lo que esta utilizando mi universidad para hacer clases y VirtualBox tiene problemas al entrar a modo fullscreen o seamless.
Así que bueno, me cambie a `cwm` el cual es un stacking window manager desarrollado como parte de `OpenBSD`, usa tan solo un archivo de configuración en el `$HOME` donde se pueden configurar grupos, los que son equivalente a los típicos workspaces, y cambiar los key bindings para ejecutar programas, mover ventanas en la pantalla y entre grupos, hay solo un par de opciones mas que cambiar en realidad por lo que se siente bastante minimalista comparado con `OpenBox` por usar XML y tener mil opciones.
La configuración que estoy usando para `cwm` es la siguiente:
:::sh
moveamount 10
gap 25 15 15 15
ignore polybar
sticky yes
autogroup 1 Firefox
autogroup 8 Spotify
autogroup 9 Thunderbird
unbind-key all
unbind-mouse all
bind-key 4S-r restart
bind-key 4S-e quit
bind-key 4-d "dmenu_custom -r -e cwm"
bind-key 4C-h window-resize-left
bind-key 4C-j window-resize-down
bind-key 4C-k window-resize-up
bind-key 4C-l window-resize-right
bind-key 4-f window-maximize
bind-key 4S-f window-fullscreen
bind-key M-Tab window-cycle-ingroup
bind-key 4S-q window-delete
bind-mouse 4-1 window-move
bind-mouse 4-3 window-resize
bind-mouse 4-2 window-stick
bind-key 4-1 group-only-1
bind-key 4-2 group-only-2
bind-key 4-3 group-only-3
bind-key 4-4 group-only-4
bind-key 4-5 group-only-5
bind-key 4-6 group-only-6
bind-key 4-7 group-only-7
bind-key 4-8 group-only-8
bind-key 4-9 group-only-9
bind-key 4S-1 window-movetogroup-1
bind-key 4S-2 window-movetogroup-2
bind-key 4S-3 window-movetogroup-3
bind-key 4S-4 window-movetogroup-4
bind-key 4S-5 window-movetogroup-5
bind-key 4S-6 window-movetogroup-6
bind-key 4S-7 window-movetogroup-7
bind-key 4S-8 window-movetogroup-8
bind-key 4S-9 window-movetogroup-9
bind-key 4S-h "tile l"
bind-key 4S-j "tile b"
bind-key 4S-k "tile t"
bind-key 4S-l "tile r"
bind-key 4-h "move l"
bind-key 4-j "move b"
bind-key 4-k "move t"
bind-key 4-l "move r"
Realmente la mayoría de la configuración que tengo es para mover las ventanas alrededor al estilo de un tiling window manager, porque esas costumbres no mueren.
Lo otro que tengo es `polybar` con un script bastante pequeño, porque cuando configure esto mi idea era que realmente era un ambiente para usar solo la maquina virtual de Windows, por lo que lo único que necesitaría saber en cada momento era la hora, si mi micrófono esta muteado y la batería disponible.
[bar/bar]
width = 100%
height = 15
override-redirect=true
background = ${xrdb:background:#222}
foreground = ${xrdb:foreground:#fff}
padding = 3
module-margin = 1
font-0 = "monospace:pixelsize=10;0"
separator = |
wm-name = polybar
modules-left = window
modules-right = muted date battery
[module/window]
type = internal/xwindow
[module/battery]
type = internal/battery
battery = BAT0
adapter = AC
full-at = 100
[module/date]
type = internal/date
interval = 10
date = %d/%m
time = %H:%M
label = %time%
[module/muted]
type = custom/script
exec = is_muted
tail = true
Para configurar el color y todo eso estoy simplemente usando pywal con la imagen de fondo y la saturacion al 100%
Lo ultimo que afecta directamente a todo lo que hago, es la configuración de `urxvt`, la cual igual que todo, bastante cortita, la fuente que sea la `monospace` global, actualmente es `envypn`, un borde interno y quitando la scrollbar que realmente no hace falta.
URxvt.font: xft:monospace
URxvt.letterSpace: 0
URxvt.lineSpace: 1
URxvt.internalBorder: 30
URxvt.cursorBlink: true
URxvt.cursorUnderline: false
URxvt.scrollBar: false
URxvt.saveLines: 10000
URxvt.depth: 32
Y eso es en resumen este setup que ocupo ahorita, hay unos cuantos scripts que uso comúnmente, `screenshot`, `is_mute`, `move`, `tile` y `cpu`, ademas de varios programas que uso siempre, `dmenu`, `pass`, `sxhkd` y otros, todo esto esta subido a mi `git`, al menos lo intento mantener actualizado.

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

73
src/style.css Executable file
View File

@@ -0,0 +1,73 @@
:root{
--background-color: hsl(10, 20%, 98%);
--foreground-color: hsl(10, 10%, 13%);
--primary-color: hsl(200, 90%, 40%);
--highlight-color: hsl(290, 86%, 43%);
--light-color: hsl(10, 10%, 40%);
}
body {
background-color: var(--background-color);
color: var(--foreground-color);
overflow-y: scroll;
font-family: 'Source Sans Pro', sans-serif;
font-size: 1.5em;
}
@media only screen and (max-width: 800px) {
body {
font-size: 1em;
}
}
.container {
max-width: 80ch;
padding: 2ch;
padding-bottom: 5em;
margin: auto;
}
h1 {
margin: 1em 0;
}
time {
color: var(--light-color);
}
p {
line-height: 1.5em;
text-align: justify;
}
a, a:visited {
color: var(--highlight-color);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
img {
max-width: 100%;
cursor: pointer;
}
code {
font-size: 1.2em;
}
.codehilite {
font-family: 'Source Code Pro', monospace;
font-size: 1.2em;
border: none;
border-radius: 5px;
overflow-x: auto;
}
.codehilite pre {
margin: 1em;
}