Skip to content

Instantly share code, notes, and snippets.

Avatar

Mehmet Akif TAŞOVA makiftasova

  • Istanbul, Turkey
View GitHub Profile
View atoi_r.c
#include <stdio.h> /* printf, fgets */
#include <stdlib.h> /* atoi */
#include <string.h>
/**
* atoi_r : a wrapper for atoi.
* atoi from stdlib.h has undefined behaviour if input does not contain
* a valid integer value. this function handles that undefined behaviour
* for non negative integers.
*
View 0001-updating-for-stockfish-8.patch
From 4a4fc1a5481afdbb1238e5edca09b17a25c7cab0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mehmet=20Akif=20TA=C5=9EOVA?= <makiftasova@gmail.com>
Date: Mon, 16 Jan 2017 02:06:10 +0300
Subject: [PATCH] updating for stockfish 8
---
.SRCINFO | 6 +++---
PKGBUILD | 5 +++--
2 files changed, 6 insertions(+), 5 deletions(-)
@makiftasova
makiftasova / 50-elantech-touchpad.conf
Last active Jun 18, 2020
[libinput] /usr/share/X11/xorg.conf.d/50-elantech-touchpad.conf file for configuring ETPS/2 Elantech touchpads
View 50-elantech-touchpad.conf
Section "InputClass"
Identifier "touchpad"
MatchIsTouchpad "on"
MatchProduct "ETPS/2|Elantech"
Driver "libinput"
Option "Tapping" "on"
Option "TappingButtonMap" "lmr"
Option "DisableWhileTyping" "on"
Option "DisableWhileTyping" "on"
Option "NaturalScrolling" "on"
View telepot_broadcast_sniplet.py
async def command_start(bot, chat_id, args):
if args['chat_type'] in ('group', 'supergroup'):
bot.broadcast_targets.append(chat_id)
async def command_broadcast(bot, chat_id, args):
"""
args = {'user_id': TELEGRM_USER_ID, 'username': TELEGRAM_USER_NAME, 'params': ['hello', 'world']}
"""
user_id = args['user_id']
if user_id in bot.mods:
View telegram_echo_markdown.py
import sys
import asyncio
import telepot
import telepot.aio
class MarkdownBot(telepot.aio.Bot):
async def handle(self, msg):
flavor = telepot.flavor(msg)
@makiftasova
makiftasova / env-gcc-i686-elf
Created Aug 16, 2016
Simple bash script to set environment for building cross gcc
View env-gcc-i686-elf
# File : env-gcc-i686-elf
# Author: Mehmet Akif TAŞOVA
# Usage : To setup environment use "source env-gcc-i686-elf"
# To deactivate environemnt, give "deactivate" command
# set $TARGET to your target arch
export _OLD_BASH_PS1="$PS1"
export _ORIG_PATH="$PATH"
function deactivate(){
@makiftasova
makiftasova / pip-upgrade.py
Created Aug 7, 2016
A Python script to upgrade all installed pip packages.
View pip-upgrade.py
#!/usr/bin/env python3
"""pip-upgrade.py: A Python script to upgrade all installed pip packages."""
__author__ = "Mehmet Akif TAŞOVA"
__email__ = "makiftasova@gmail.com"
__license__ = "GPLv3+"
__version__ = "1.0.0"
View command_aware_telepot.py
#!/usr/bin/env python3
"""
Mehmet Akif TAŞOVA <makiftasova@gmail.com>
A Sample class derieved from telepot.async.Bot which has an implemented command handle mechanism
"""
import telepot
import telepot.async
import asyncio
@makiftasova
makiftasova / telepot_sample_commands.py
Last active Jan 30, 2016
A sample code for handling bot commands with telepot.
View telepot_sample_commands.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Mehmet Akif TAŞOVA <makiftasova@gmail.com>
# A sample code for handling bot commands with telepot
#
import time
import telepot
View unlock-mobile-broadband-device.sh
#!/usr/bin/bash
# Author: Mehmet Akif TAŞOVA <makiftasova@gmail.com>
# A simple shell script to unlock mobile broadband devices
# on linux systems.
# depends on mmcli utility.
if [ $# -eq 1 ] ; then
echo "device #$1 sims are:"
mmcli -m $1 | grep SIM