This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import tee | |
def triplewise(iterable): | |
"""triplewise('ABCDEFG') --> ABC BCD CDE DEF EFG""" | |
a, b, c = tee(iterable, 3) | |
next(b, None) | |
next(c, None) | |
next(c, None) | |
return zip(a, b, c) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Author: Gokberk Akdeniz | |
import math | |
def f(x): | |
#fonksiyonu gir buraya | |
return x * (math.cos(x)) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
HELP="Usage: mv.md5 [OPTION] SOURCE | |
Rename SOURCE to md5 hash of itself. | |
-R, --recursive rename all files in the given folder | |
-h, --help show help" | |
function mv_md5() { | |
dest=`dirname "$1"`/`md5sum "$1" | cut -d" " -f1`."${1##*.}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
# Copyright (c) 2020 Gökberk Akdeniz | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
//if your input is negative number, it will show input+2^32 | |
unsigned int number; // max value: 2^32 | |
int i; | |
printf("Enter a number: "); | |
scanf("%d", &number); | |
for(i = 31; i >= 0; i--) { | |
if ((1 << i) > number) { //put 0 until number < 2^i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import system | |
import re | |
board = [["-", "-", "-"], | |
["-", "-", "-"], | |
["-", "-", "-"]] | |
move = "" | |
moves = 0 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Author: Gokberk AKDENIZ | |
# Date: 11.11.2017 | |
# Description: Script for aligning the center of | |
# user's active window with the center of the monitor | |
# Tested on: Debian 9.2 stretch | |
# Original: https://gist.github.com/SergKolo/328548cc3c2b4597d7f7ab91db26709d | |