Skip to content

Instantly share code, notes, and snippets.

View makiftasova's full-sized avatar

Mehmet Akif TAŞOVA makiftasova

  • Istanbul, Turkey
View GitHub Profile
#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.
*
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 June 18, 2020 11:57
[libinput] /usr/share/X11/xorg.conf.d/50-elantech-touchpad.conf file for configuring ETPS/2 Elantech touchpads
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"
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:
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 August 16, 2016 18:41
Simple bash script to set environment for building cross gcc
# 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 August 7, 2016 04:01
A Python script to upgrade all installed pip packages.
#!/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"
#!/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 January 30, 2016 19:21
A sample code for handling bot commands with telepot.
#!/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
#!/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