Skip to content

Instantly share code, notes, and snippets.

View Adurtxi's full-sized avatar
馃彔
Working from home

Adur Marques Adurtxi

馃彔
Working from home
View GitHub Profile
@Adurtxi
Adurtxi / index.html
Last active July 17, 2021 16:59
Index example for Nginx
<html>
<head>
<title>Nginx && Ubuntu 21.04</title>
</head>
<body>
<h1>Nginx instalado correctamente gracias a Koda.es</h1>
</body>
</html>
@Adurtxi
Adurtxi / nginx.conf
Created July 17, 2021 15:08
Nginx config
...
http {
...
server_names_hash_bucket_size 64;
...
}
...
server {
listen 80;
listen [::]:80;
root /var/www/tu_dominio;
index index.html index.htm index.nginx-debian.html;
server_name tu_dominio www.tu_dominio;
location / {
@Adurtxi
Adurtxi / de-todo.js
Last active June 11, 2021 21:35
De todo con Javascript
const generateRandomColor = () => {
const colorNumber = Math.random() * 0xfffff * 100000;
const colorString = colorNumber.toString(16);
return '#' + colorString.slice(0, 6);
};
console.log(generateRandomColor());
@Adurtxi
Adurtxi / fechas-en-js.js
Created June 5, 2021 16:18
Fechas en Js
addOneDayToDate(date) {
let newDate = new Date();
newDate.setDate(date.getDate() + 1);
return newDate;
}
const date = new Date('2021-06-30');
@Adurtxi
Adurtxi / objetos-js.js
Last active June 2, 2021 19:51
Objetos en JS
const object = {
'like': 'Dale like si te ha gustado',
'comment': 'Comenta y dime que te ha parecido',
'share' : 'Comparte a quien le pueda interesar'
}
const { like, comment, share } = object;
console.log(like, comment, share);
@Adurtxi
Adurtxi / array.js
Last active June 1, 2021 08:05
Array JS
//////////////// A帽adir ////////////////
let array = [1, 2, 3, 4, 5];
array = [...array, 6];
let array = [1, 2, 3, 4, 5];
array.push(6);
@Adurtxi
Adurtxi / funciones.js
Last active May 31, 2021 15:24
Funciones en JS
basic('Hola Mundo - Antes');
function basic(text) {
return text;
}
basic('Hola Mundo - Despu茅s');
const arrowFunction = (text) => {
@Adurtxi
Adurtxi / estructura-if-en.js
Last active May 31, 2021 15:39
Estructura de IF en JS
if (condition) {
console.log('Condici贸n es verdadera');
}
else if (condition2) {
console.log('Condici贸n no es verdadera pero Condici贸n2 si');
}
else {
console.log('Ni Condici贸n ni Condici贸n2 son verdaderas');
}
@Adurtxi
Adurtxi / shared-preferences-get-set-example.dart
Created May 14, 2021 14:52
Set y Get con SharedPreferences
final _prefs = MainPreferences();
void setString() {
_prefs.string = savedString;
}
void getString() {
savedString = _prefs.string;
}