Skip to content

Instantly share code, notes, and snippets.

View diegoulloao's full-sized avatar
👾
creative mode

Diego Ulloa diegoulloao

👾
creative mode
View GitHub Profile
<script lang="ts">
// svelte
import { page } from '$app/stores';
// custom components
import { AddSquareButton } from '@components/custom';
// parts
import {
FoodItem,
@diegoulloao
diegoulloao / .env
Last active April 14, 2022 16:39
Bananasplit-js .env example
# [Node]
NODE_ENV="development"
# [Sequelize]
DB_DIALECT="mysql"
# [Database]
DB_HOST="127.0.0.1"
DB_PORT="3306"
DB_DATABASE="db_backend"
@diegoulloao
diegoulloao / fibonacci.js
Last active March 19, 2022 03:27
Fibonacci with generator functions
// 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
const fibonacci = function* () {
let n1 = 0
let n2 = 1
yield n1
yield n2
while (true) {
@diegoulloao
diegoulloao / .vimrc
Last active October 29, 2022 03:39
My vim conf
" __ __ _____ _____ ____ _ ______ _____
" \ \ / /\ | __ \|_ _| /\ | _ \| | | ____|/ ____|
" \ \ / / \ | |__) | | | / \ | |_) | | | |__ | (___
" \ \/ / /\ \ | _ / | | / /\ \ | _ <| | | __| \___ \
" \ / ____ \| | \ \ _| |_ / ____ \| |_) | |____| |____ ____) |
" \/_/ \_\_| \_\_____/_/ \_\____/|______|______|_____/
let theme="farout"
" theme list: gruvbox|ayu|pop-punk|fahrenheit|farout
@diegoulloao
diegoulloao / Photos-React+Typescript+JSDocs+MaterialUI.js
Last active February 7, 2020 07:09
Photos component in React vs. Svelte
/**
*
* Photos React TSX Component
* @module ./components/Photos.tsx
*
*/
import React from 'react'
@diegoulloao
diegoulloao / so-info.sh
Created October 18, 2019 02:28
Returns SO info (generic in all linux distributions)
# linux
cat /etc/os-release
# unix
uname
# Darwin: MacOS
# Linux: Linux
@diegoulloao
diegoulloao / git-io-custom-url.md
Created October 10, 2019 22:43 — forked from dikiaap/git-io-custom-url.md
git.io custom URL

Command:

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"

URLs that can be created is from:

  • https://github.com/*
  • https://*.github.com
  • https://*.github.com/*
  • https://*.github.io
@diegoulloao
diegoulloao / get-script-dir.sh
Created April 21, 2019 01:35
Get current script called directory no matter where called.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# from https://stackoverflow.com/questions/59895/get-the-source-directory-of-a-bash-script-from-within-the-script-itself
@diegoulloao
diegoulloao / bash-get-url-status-code.sh
Last active April 20, 2019 02:36
Obtiene status de request a URL vía http.
#!/bin/sh
STATUS_CODE=`curl -s -o /dev/null -I -w "%{http_code}" "[URL]"`
@diegoulloao
diegoulloao / mysql-docker.sh
Created April 16, 2019 23:49 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE