Skip to content

Instantly share code, notes, and snippets.

View carlosvega20's full-sized avatar

Carlos Vega carlosvega20

  • San Francisco, CA
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>RXJS test</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/5.5.6/Rx.min.js"></script>
</head>
<body>
<input/>
<script id="jsbin-javascript">
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<input/>
<script id="jsbin-javascript">
@carlosvega20
carlosvega20 / .zshrc
Last active July 11, 2018 13:46
Zsh config
# Path to Oh-My-Zsh installation
export ZSH="/Users/carlosvega/.oh-my-zsh"
# Plugins
plugins=(git)
source $ZSH/oh-my-zsh.sh
PROMPT='$fg[yellow]$(echo "${PWD/$HOME/~}") $fg[cyan]$(git_prompt_info) $fg[magenta]$(node_version)
$reset_color$ '
set runtimepath^=~/.vim/bundle/ctrlp.vim
source ~/.vim/vundle
execute pathogen#infect()
syntax on
filetype plugin indent on
set background=dark
colorscheme solarized
@carlosvega20
carlosvega20 / vundle
Created July 6, 2018 20:00
vim vundle
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
const npm = async moduleName => {
console.log('Fetching ' + moduleName + '... just one second');
let res = await fetch('https://cdn.jsdelivr.net/npm/' + moduleName + '@latest');
let bd = await res.text();
console.log(bd);
};
// npm('lodash');
@carlosvega20
carlosvega20 / arrow.js
Created October 8, 2018 22:26
Arrow function
myFunc = () => {
var mensaje='hello World!';
console.log(mensaje);
};
//Can be also expressed as:
/*
function myFunc() {
var mensaje='hello World!';
@carlosvega20
carlosvega20 / Custom|JS|Editor.js
Last active March 12, 2022 20:47
Excel markdown table | Notable.app Plugin
const require = (url) => {
const head = document.getElementsByTagName('head')[0];
const script = document.createElement('script');
script.type = 'text/javascript';
script.src = url;
head.appendChild(script);
}
require("https://cdn.jsdelivr.net/npm/hyperformula/dist/hyperformula.full.min.js");
@carlosvega20
carlosvega20 / customCSSEditor.css
Created March 11, 2022 23:11
JSON Viewer for Notable.app | Custom | JS | Editor
.json-skin { font-family: monospace,'Courier'; }
.json-skin ul { padding-left: 0; display: inline; list-style: none; }
.json-skin .elm-arbol { display: inline; }
.json-skin li { padding-left: 20px; }
.json-skin ul.elm-object::before { content: '{'; font-weight: bold; }
.json-skin ul.elm-object::after { content: '}'; font-weight: bold; }
.json-skin ul.elm-array::before { content: '['; font-weight: bold; }
.json-skin ul.elm-array::after { content: ']'; font-weight: bold; }
.json-skin span.elm-more {cursor: pointer; }
.json-skin span.elm-more::before { content: '...'; font-weight: bold; color: gray; }
const fastify = require('fastify')({ logger: true });
const mysql = require('fastify-mysql');
const Joi = require('joi'); // For request validation
// Register the fastify-mysql plugin and set up the database connection with a connection pool
fastify.register(mysql, {
connectionString: 'mysql://your_username:your_password@your_database_url/your_database_name',
pool: {
min: 0,
max: 10,