Skip to content

Instantly share code, notes, and snippets.

View hkulekci's full-sized avatar
⛰️
Remote

Haydar KÜLEKCİ hkulekci

⛰️
Remote
View GitHub Profile
@hkulekci
hkulekci / dynamic_templates.md
Last active March 2, 2019 00:47
Elasticsearch Dynamic Templates Example
DELETE products

PUT products
{
  "settings": {
    "number_of_shards": 1,
    "number_of_replicas": 0
  },
 "mappings": {
@hkulekci
hkulekci / index.md
Last active February 12, 2019 22:49
Index Preparing For Medium Blog
DELETE products

PUT products
{
  "settings": {
    "number_of_shards": 1,
    "number_of_replicas": 0
  },
  "mappings": {
<?php
class Container
{
protected $container = [];
public function add($a)
{
$this->container[] = $a;
}
@hkulekci
hkulekci / container-example.php
Created November 15, 2018 18:33
Container Example
<?php
interface Container
{
public function add();
public function show();
}
class Container1 implements Container
{
@hkulekci
hkulekci / 01 - data.md
Last active October 23, 2018 18:07
Medium Example


DELETE cities

PUT cities
{
  "settings": {
    "number_of_shards": 1,
    "number_of_replicas": 0,
@hkulekci
hkulekci / Index.php
Last active August 22, 2018 08:35
Index model for apisearch php-client
<?php
declare(strict_types=1);
namespace Apisearch\Model;
use Apisearch\Exception\InvalidFormatException;
/**
* Class Coordinate.
@hkulekci
hkulekci / example.py
Last active September 7, 2019 14:57
Django Admin Example
from django.contrib import admin
from django.urls import reverse
from django.utils.datetime_safe import new_datetime
from django.utils.safestring import mark_safe
from report_project.rest_api.models import Question, Choice
class ChoiceAdmin(admin.ModelAdmin):
model = Choice
@hkulekci
hkulekci / django_error_log.log
Last active January 9, 2023 16:45
`ModuleNotFoundError: No module named 'app_name'` exception solution
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x10b5cf9d8>
Traceback (most recent call last):
File "/Volumes/webroot/python/django-test-with-python36/lib/python3.6/site-packages/django/apps/config.py", line 143, in create
app_module = import_module(app_name)
File "/Volumes/webroot/python/django-test-with-python36/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'app_name'

ES Requests :

DELETE msm_test

PUT msm_test
{
  "settings": {
    "number_of_shards": 1,
    "number_of_replicas": 0
<?php
function get_tls_version($sslversion = null)
{
$c = curl_init();
curl_setopt($c, CURLOPT_URL, "https://www.howsmyssl.com/a/check");
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
if ($sslversion !== null) {
curl_setopt($c, CURLOPT_SSLVERSION, $sslversion);
}