Skip to content

Instantly share code, notes, and snippets.

View MMaturax's full-sized avatar

Tufan Demir MMaturax

  • Frasb Inc
View GitHub Profile
@MMaturax
MMaturax / autofill.php
Created January 28, 2023 11:07 — forked from jubstuff/autofill.php
Wrap text in imagick
<?php
/**
* Auto Fit Text To Image
*
* Write text to image using a target width, height, and starting font size.
*
* @author Clif Griffin
* @url http://cgd.io/2014/auto-fit-text-to-an-image-with-php-and-wordpress
*
---------------- V5 ------------------------------
---Updated on 7/19/19
----Tutorial Videos------------------------------------------------
-----How to use: https://www.youtube.com/watch?v=F_tvWzF3x18
-----Youtube Channel: https://www.youtube.com/c/Kriptutorial

[POLL] Custom attributes in Magento GraphQL Schema

Magento GraphQL endpoints must support EAV entities such as Products. GraphQL specification requires all complex types eventually to be represented as structures of scalar types. Mixed/any types are not supported.

We have couple options to choose from and would be glad to hear your opinion on that.

Option 1: Custom attributes container

Schema

@MMaturax
MMaturax / FontMeta.php
Created July 31, 2017 05:11 — forked from nimmneun/FontMeta.php
Read / extract meta data like actual font name, font family, font subfamily, etc from ttf font files
<?php
/**
* Class FontMeta based on several stackoverflow answers.
*
* @method string getCopyright()
* @method string getFontFamily()
* @method string getFontSubFamily()
* @method string getFontIdentifier()
* @method string getFontName()
@MMaturax
MMaturax / postakodu.sql
Created April 25, 2017 00:06 — forked from ismailbaskin/postakodu.sql
İl - İlçe - semt - mahalle - posta kodu veritabanı
This file has been truncated, but you can view the full file.
DROP TABLE IF EXISTS `pk_il`;
CREATE TABLE `pk_il` (
`il_id` int(2) NOT NULL COMMENT 'plaka kodu',
`il_adi` varchar(255) NOT NULL,
PRIMARY KEY (`il_id`),
KEY `il_adi` (`il_adi`) USING BTREE
) ENGINE=MyISAM;
-- ----------------------------
@MMaturax
MMaturax / PictureCallback.java
Created January 23, 2017 21:47 — forked from tomoima525/PictureCallback.java
Android code to make jpeg picture that fits with camera preview size
PictureCallback jpegCallback=new PictureCallback(){
@Override
public void onPictureTaken(byte[] data, Camera camera) {
if(data !=null){
/* I use Galaxy S3 and Supported PictureSize was width = 3264px, height = 2448px, prop = 1.3333334
Because inSampleSize should be integer, I set maxSize a fraction of srcSize(Supported Picturesize)
*/
int maxSize = 816;
mCamera.stopPreview();
# ========================================
# Testing n-gram analysis in ElasticSearch
# ========================================
curl -X DELETE localhost:9200/test
curl -X PUT localhost:9200/test -d '
{
"settings" : {
"index" : {
"analysis" : {
# [unsolved question] How to get google like autosuggest term list by token by elasticsearch
# mapping including a tokenizer and a filter
curl -XPUT 'http://127.0.0.1:9200/files/?pretty=1' -d '
{
"settings" : {
"analysis" : {
"analyzer" : {
"filename_search" : {
"tokenizer" : "filename",
def self.create_index_with_mappings
Tire.index Settings.elasticsearch_product_index do
create :settings => {
:number_of_shards => 1,
:number_of_replicas => 1,
:analysis => {
:filter => {
:name_ngrams => {
:side => 'front',
:type => 'edgeNGram',