Skip to content

Instantly share code, notes, and snippets.

View MehmetGoekce's full-sized avatar
🎯
Focusing

Mehmet Gökçe MehmetGoekce

🎯
Focusing
View GitHub Profile
@MehmetGoekce
MehmetGoekce / tools.py
Last active March 3, 2025 16:12
A customer support agent might have tools for
async def search_knowledge_base(query: str, product_category: str = None) -> List[Dict]:
"""Search knowledge base for relevant articles."""
# Implementation details...
return relevant_articles
async def update_ticket_status(ticket_id: str, new_status: str, notes: str = None) -> Dict:
"""Update the status of a support ticket."""
# Implementation details...
return update_result
@MehmetGoekce
MehmetGoekce / install
Created May 14, 2024 09:57
Install libjansson
apt install libjansson4 libjansson-dev
@MehmetGoekce
MehmetGoekce / Install
Last active May 14, 2024 09:54
Install dependencies Emacs needs
add-apt-repository ppa:ubuntu-toolchain-r/ppa
apt update
apt install gcc-11 libgccjit0 libgccjit-11-dev
apt build-dep emacs
@MehmetGoekce
MehmetGoekce / example.php
Created February 9, 2020 13:58
numerical literal seperator
<?php
6.674_083e-11; // float
299_792_458; // decimal
0xCAFE_F00D; // hexadecimal
0b0101_1111; // binary
0137_041; // octal
@MehmetGoekce
MehmetGoekce / numeric.php
Created February 9, 2020 13:56
underscores in numeric variables
<?php
// previously
$number = 987654321.22; // hard to read
// now
$price = 987_654_321.22; // easy to read
@MehmetGoekce
MehmetGoekce / arrref.php
Created February 9, 2020 13:51
element stored in first array
<?php
$arr0 = 'red';
$arr1 = [&$arr0, 'green', 'blue'];
$arr2 = ['white', ...$arr1, 'black'];
@MehmetGoekce
MehmetGoekce / pbref.php
Created February 9, 2020 13:50
not allowed to unpack arrays that are passed for reference
<?php
$arr1 = ['red', 'green', 'blue'];
$arr2 = [...&$arr1];
@MehmetGoekce
MehmetGoekce / gensyn.php
Created February 9, 2020 13:49
generator sytnax
<?php
function generator() {
for ($i = 3; $i <= 5; $i++) {
yield $i;
}
}
$arr1 = [0, 1, 2, ...generator()];
@MehmetGoekce
MehmetGoekce / unpackarray.php
Created February 9, 2020 13:47
unpack arrays returned by a function
<?php
function buildArray(){
return ['red', 'green', 'blue'];
}
$arr1 = [...buildArray(), 'black', 'violet', 'yellow'];
<?php
$arr1 = [1, 2, 3];
$arr2 = [4, 5, 6];
$arr3 = [...$arr1, ...$arr2];
$arr4 = [...$arr1, ...$arr3, 7, 8, 9];