Skip to content

Instantly share code, notes, and snippets.

View ahmethakanbesel's full-sized avatar

Ahmet Hakan Beşel ahmethakanbesel

View GitHub Profile
@ahmethakanbesel
ahmethakanbesel / exam-grades-histogram.ipynb
Created June 21, 2023 05:45
Visualize exam grades by creating histograms with Plotly.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ahmethakanbesel
ahmethakanbesel / tefas-scraper.py
Created March 2, 2023 20:20
Get fund details from tefas.gov.tr
import struct
import time
from datetime import datetime, timezone, timedelta
import pytz
import requests
from bs4 import BeautifulSoup
import database
from helpers import days_between, convert_date
import subprocess
import platform
import requests
import threading
import os
url = "http://bys.marmara.edu.tr/Ogrenci/Ogr0208/SecilenDersler.aspx"
payload = {}
from itertools import combinations
num_of_courses = 2 # number of courses except mandatory courses
# [day, hour]
# Monday=1 ... Friday=5
te_courses = [
{'id': 'CSE4057', 'fullName': 'Information Systems Security', 'hours': [[4, 2], [4, 3], [5, 3]]},
{'id': 'CSE4060', 'fullName': 'Principles of Prog. Lang.', 'hours': [[1, 4], [1, 5], [5, 1]]},
{'id': 'CSE4062', 'fullName': 'Introduction to Data Science', 'hours': [[2, 2], [2, 3], [5, 2]]},
@ahmethakanbesel
ahmethakanbesel / oxford-dictionary-csv-export.py
Created May 2, 2022 06:48
Oxford Learner's Dictionaries CSV Export Tool
import os
from bs4 import BeautifulSoup
import requests
if __name__ == '__main__':
words = [
['Word', 'CEFR Level', 'Type', 'Definition Path', 'British MP3', 'British OGG', 'American MP3', 'American OGG']]
cache_file = 'page.html'
@ahmethakanbesel
ahmethakanbesel / arduino-dc-motor.ino
Created May 24, 2020 20:10
Arduino DC Motor Yön ve Hız Kontrolü
int butonPin = 8;
int potPin = A0; //A0 analog pini pot değişkenine atadık
int potdeger; //Kodlarımız içerisinde kullanacağımız potdeger değişkenini oluşturduk
int enablePin = 11;
int in1Pin = 10;
int in2Pin = 9;
int state = HIGH;
int reading;
int previous = LOW;
long time = 0;
@ahmethakanbesel
ahmethakanbesel / battery.js
Created February 10, 2018 20:26
Javascript Battery Level GUI
var pil = navigator.battery || navigator.webkitBattery || navigator.mozBattery;
function pilDurumu(pil) {
document.getElementById('seviye').innerHTML += ' %' + pil.level * 100;
document.getElementById('yuzde').value = pil.level * 100;
if (pil.charging === true) {
var durum = "Şarj oluyor";
} else {
var durum = "Şarjda değil";
}
<script>
var loadDeferredStyles = function() {
var addStylesNode = document.getElementById("deferred-styles");
var replacement = document.createElement("div");
replacement.innerHTML = addStylesNode.textContent;
document.body.appendChild(replacement)
addStylesNode.parentElement.removeChild(addStylesNode);
};
var raf = requestAnimationFrame || mozRequestAnimationFrame ||
webkitRequestAnimationFrame || msRequestAnimationFrame;
@ahmethakanbesel
ahmethakanbesel / css-render.html
Created September 29, 2017 16:13
Oluşturmayı önleyen JavaScript ve CSS kodlarını ekranın üst kısmındaki içerikten kaldırın
<noscript id="deferred-styles">
<link rel="stylesheet" type="text/css" href="stil.css"/>
</noscript>
@ahmethakanbesel
ahmethakanbesel / wordpress-javascript-defer.php
Created September 29, 2017 16:04
Wordpress Defer Javascript
/*
* Defer Javascript
*/
add_filter( 'clean_url', function( $url )
{
if ( FALSE === strpos( $url, '.js' ) )
{
return $url;
}
return "$url' defer='defer";