Skip to content

Instantly share code, notes, and snippets.

View devCharles's full-sized avatar
:octocat:
koding </>

Charles Silva devCharles

:octocat:
koding </>
View GitHub Profile
@devCharles
devCharles / artistas_y_ciudades.js
Created September 18, 2023 21:36
DataSet: artistas_y_ciudades_donde_mas_se_escuchan
const artistas_y_ciudades = [
{
"artist": "Miley Cyrus",
"country": "United States"
},
{
"artist": "FIFTY FIFTY",
"country": "United Kingdom"
},
{
@devCharles
devCharles / next-shows.json
Created July 14, 2023 02:03
netflix shows
This file has been truncated, but you can view the full file.
[
{
"show_id": "s1",
"type": "Movie",
"title": "Dick Johnson Is Dead",
"director": "Kirsten Johnson",
"cast": "",
"country": "United States",
"date_added": "September 25, 2021",
"release_year": 2020,
@devCharles
devCharles / EC2-config-not-pem.md
Last active October 12, 2020 22:09
Configure AWS EC2 to use ssh keys instead of .pem files

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
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'}
]

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 / ObjectMethodsAndRecursivity.js
Created May 9, 2019 09:33
Crear una función que transforme todas las llaves de un objeto en llaves escritas en lowerCamelCase (solo las llaves)
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 08:26
Calcular la diferencia de la suma de las diagonales de una matriz cuadrada
const matrix = [
[1, 2, -1],
[6, 5, 4],
[-9, 8, 9]
]
function getDiagonalsDifference (matrix) {
// complete function
}
# 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 January 18, 2018 07:49
a function to delete all unnecessary nested, or void data in a json recursivly
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 October 7, 2017 06:56
nginx reverse proxy to point a certain node aplication
/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;