Skip to content

Instantly share code, notes, and snippets.

View AnechaS's full-sized avatar
😀
Hello

Anecha Kuekharem AnechaS

😀
Hello
View GitHub Profile
@AnechaS
AnechaS / meta-tags.md
Created August 20, 2024 04:47 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@AnechaS
AnechaS / Dockerfile
Last active May 12, 2023 12:15
Docker apache httpd server with SSL/HTTPS and HTTP support.
FROM httpd:2.4
COPY httpd.conf /usr/local/apache2/conf/httpd.conf
COPY index.html /usr/local/apache2/htdocs/index.html
RUN apt-get update \
&& apt-get -y install openssl \
&& cd /usr/local/apache2/conf \
&& openssl req -new -newkey rsa:2048 -days 365 -nodes -x509 -keyout server.key -out server.crt -subj '/CN=localhost'
@AnechaS
AnechaS / docker-compose.yml
Last active May 12, 2023 08:56
docker-compose config for elasticsearch and kibana
version: '3.8'
services:
elasticsearch:
container_name: es
image: docker.elastic.co/elasticsearch/elasticsearch:8.4.3
environment:
- xpack.security.enabled=false
- "discovery.type=single-node"
networks:
@AnechaS
AnechaS / index.js
Last active April 25, 2023 15:01
JavaScript Get object value by path
/**
* Get the object value by path
* @param {object} obj
* @param {string} path
* @return {any}
* @example
* getObjectValue({ str: 'string', int: 0 }, 'str'); //=> 'string'
* getObjectValue({ obj: { str: 'string', int: 0 } }, 'obj.str'); //=> 'string'
* getObjectValue({ arr: [{ str: 'string', int: 0 }] }, 'obj[0].str'); //=> 'string'
* getObjectValue({ arr: [{ str: 'string', int: 0 }] }, 'obj[*].str'); //=> ['string']
@AnechaS
AnechaS / findPropertyPathWithValue.js
Last active April 25, 2023 15:01
Javascript find property path in object with a value.
/**
* Find property path in the object with a value
* @param {object} obj
* @param {any} value
* @return {string}
*/
function findPropertyPathWithValue(obj, value) {
for (const key in obj) {
if (JSON.stringify(value) === JSON.stringify(obj[key])) {
return key;