Skip to content

Instantly share code, notes, and snippets.

@ozdemirburak
ozdemirburak / TurkishString.php
Created November 18, 2017 17:21
Class that handles string operations lowercase, uppercase, ucfirst, and ucwords in Turkish, solves the Turkish İ problem.
<?php
/*
* Package: https://github.com/epigra/trstringhelper
*/
class TurkishString
{
/**
* @var array
*/
@ozdemirburak
ozdemirburak / prime.php
Created April 28, 2017 22:18
Find all prime numbers up to any given n using Sieve of Eratosthenes.
<?php
/**
* Find all prime numbers up to any given n using Sieve of Eratosthenes.
*
* https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
* https://en.wikipedia.org/wiki/Eratosthenes
*
* @param int $n
*
@ozdemirburak
ozdemirburak / countries_in_turkish.json
Last active October 7, 2023 21:49
Ülkelerin İngilizce ve Türkçe yazılışı - Country names in Turkish.
{
"AD": {
"name": "Andorra",
"name_tr": "Andorra",
"continent": {
"code": "EU",
"name": "Europe",
"name_tr": "Avrupa"
}
},
@ozdemirburak
ozdemirburak / cities_of_turkey.json
Last active April 24, 2024 16:02
List of cities in Turkey presented in JSON format with the information of name, latitude, longitude, population and region.
[
{
"id": 1,
"name": "Adana",
"latitude": "37.0000",
"longitude": "35.3213",
"population": 2183167,
"region": "Akdeniz"
},
{
@ozdemirburak
ozdemirburak / converter.c
Last active April 30, 2021 11:41
UTF8, UTF16, UTF32, ISO8859 conversions
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdint.h>
#include <stddef.h>
int getSize(unsigned char *);
unsigned char * fileToBuffer(unsigned char *);
unsigned char * replaceCharset(const char *, const char *, const char *);