Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
koding </>

Charles Silva devCharles

:octocat:
koding </>
View GitHub Profile
View hashTables.js
const productosComprados = [
{ name: 'arroz', precio: 1, unidad: '1kg' },
{ name: 'frijoles', precio:6, unidad: '2kg' },
{ name: 'coca', precio: 3, unidad: '500ml' },
{ name: 'frijoles', precio: 6, unidad: '2kg' },
{ name: 'coca', precio: 3, unidad: '500ml' },
{ name: 'frijoles', precio: 6, unidad: '2kg' },
{ name: 'chocolate', precio: 7, unidad: 'barra'}
]
View keybase.md

Keybase proof

I hereby claim:

  • I am devcharles on github.
  • I am devcharles (https://keybase.io/devcharles) on keybase.
  • I have a public key ASB8l8izBHuSnubXWZVAqJNa_B9_Ov-FpchkMaM1lH8ewAo

To claim this, I am signing this object:

@devCharles
devCharles / EC2-config-not-pem.md
Last active Oct 12, 2020
Configure AWS EC2 to use ssh keys instead of .pem files
View EC2-config-not-pem.md

EC2 config to not use pem file and use ssh key instead

  1. Open sshd_config file
sudo vi /etc/ssh/sshd_config
  1. Look for PasswordAuthentication No and change it to PasswordAuthentication Yes
  2. Save the file
  3. Restart ssh demon
@devCharles
devCharles / ObjectMethodsAndRecursivity.js
Created May 9, 2019
Crear una función que transforme todas las llaves de un objeto en llaves escritas en lowerCamelCase (solo las llaves)
View ObjectMethodsAndRecursivity.js
const cliente = {
Nombre: 'Jorge Rodriguez',
Edad: 35,
DireccionOficina: 'Oaxaca 96 Roma Norte',
DireccionCasa: 'Salamanca 15',
HistorialDeLentesComprados: {
Notorious: {
Color: 'negro',
TipoDeMica: 'bluelight',
Graduacion: {
@devCharles
devCharles / matrizCuadrada.js
Created May 9, 2019
Calcular la diferencia de la suma de las diagonales de una matriz cuadrada
View matrizCuadrada.js
const matrix = [
[1, 2, -1],
[6, 5, 4],
[-9, 8, 9]
]
function getDiagonalsDifference (matrix) {
// complete function
}
View .zshrc
# Path to your oh-my-zsh installation.
export ZSH="/home/charles/.oh-my-zsh"
################## SPACE SHIP THEME VARIABLES ###################
SPACESHIP_CHAR_SYMBOL=">> "
SPACESHIP_PACKAGE_SHOW=false
SPACESHIP_BATTERY_SHOW=false
SPACESHIP_DOCKER_SHOW=false
SPACESHIP_NODE_SHOW=false
######################### PRESET
@devCharles
devCharles / cleanObject.js
Created Jan 18, 2018
a function to delete all unnecessary nested, or void data in a json recursivly
View cleanObject.js
const isPlainObject = require('lodash/isPlainObject')
const isString = require('lodash/isString')
const isNumber = require('lodash/isNumber')
const map = require('lodash/map')
const reduce = require('lodash/reduce')
function cleanObject (obj = {}) {
if (isNumber(obj)) return obj
if (isString(obj)) {
return (obj.trim().length === 0) ? null : obj
@devCharles
devCharles / nginx reverse proxy
Created Oct 7, 2017
nginx reverse proxy to point a certain node aplication
View nginx reverse proxy
/etc/nginx/nginx.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/api
location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
View linux-solutions.md