Skip to content

Instantly share code, notes, and snippets.

View Jimmea's full-sized avatar

Hungokata Jimmea

  • Vnp group
  • Hà Nội
View GitHub Profile
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
@Jimmea
Jimmea / nginx.default.conf
Created March 29, 2020 16:02 — forked from ArunMichaelDsouza/nginx.default.conf
Default NGINX Configuration
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
docker network create elasticsearch-kibana
docker run \
--name elastic_container \
--network elasticsearch-kibana \
--publish 9200:9200 \
--publish 9300:9300 \
--env "discovery.type=single-node" \
docker.elastic.co/elasticsearch/elasticsearch:6.4.2
docker network create elasticsearch-kibana
docker run \
--name elastic_container \
--network elasticsearch-kibana \
--publish 9200:9200 \
--publish 9300:9300 \
--env "discovery.type=single-node" \
docker.elastic.co/elasticsearch/elasticsearch:6.4.2
docker network create elasticsearch-kibana
docker run \
--name elasticsearch_container \
--network elasticsearch-kibana \
--publish 9200:9200 \
--publish 9300:9300 \
--env "discovery.type=single-node" \
docker.elastic.co/elasticsearch/elasticsearch:7.6.2
# File: /etc/nginx/nginxconfig.io/php_fastcgi.conf
# 404
try_files $fastcgi_script_name =404;
# default fastcgi_params
include fastcgi_params;
# fastcgi settings
# /etc/nginx/nginxconfig.io/general.conf
# favicon.ico
location = /favicon.ico {
log_not_found off;
access_log off;
}
# robots.txt
location = /robots.txt {
@Jimmea
Jimmea / keywordsbyurl.php
Created June 29, 2020 06:37 — forked from stefanocudini/keywordsbyurl.php
php keywords generator by url page
<?
//inspired by: http://nadeausoftware.com/articles/2008/04/php_tip_how_extract_keywords_web_page
function keywordsByUrl($url, $minwordlen = 4, $minwordnum = 3, $maxwords = 10)
{
$text = strip_html_tags(file_get_contents($url));
$text = html_entity_decode($text, ENT_QUOTES, "utf-8");
$text = strip_punctuation($text);
$text = strip_symbols($text);
@Jimmea
Jimmea / docker-compose-v1.yml
Created August 20, 2020 09:50 — forked from markheath/docker-compose-v1.yml
Elasticsearch docker compose examples
version: '2.2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.4.1
container_name: elasticsearch
environment:
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
@Jimmea
Jimmea / php-cachetool-usage.md
Created September 1, 2020 08:47 — forked from jdeathe/php-cachetool-usage.md
How to Clear PHP Opcache without Restarting PHP-FPM.

PHP CacheTool - Manage cache in the CLI

Use CacheTool to view stats for and manage PHP's APC or Zend Opcache opcode cache.

Using CacheTool you can clear the PHP opcache without reloading PHP-FPM.

In this example, CacheTool is to be installed alongside a demonstration PHP-FPM Docker container.

Prerequisites