Skip to content

Instantly share code, notes, and snippets.

View erdemarslan's full-sized avatar
🙄
I may be slow to respond.

Erdem Arslan erdemarslan

🙄
I may be slow to respond.
View GitHub Profile
@erdemarslan
erdemarslan / coin.ino
Last active July 27, 2018 11:45
Limonata Makinesi Test 1
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3F, 16,2);
const byte coinPin = 2;
const byte buttonPin = 3;
const byte motorPin = 6;
volatile double lira = 0.00;
volatile int paraGeldimi = 0;
@erdemarslan
erdemarslan / python download file with percent.py
Last active June 2, 2024 19:19
Download any file with percent on Python
import certifi
import urllib3
url = "http://www.serveraddress.tld/file/to/download.zip"
file_name = url.split('/')[-1]
http = urllib3.PoolManager(
cert_reqs='CERT_REQUIRED',
ca_certs=certifi.where()
@erdemarslan
erdemarslan / Check Internet Connection.py
Last active July 6, 2022 05:29
Python check internet connection
import urllib3
def check_internet_conn():
http = urllib3.PoolManager(timeout=3.0)
r = http.request('GET', 'google.com', preload_content=False)
code = r.status
r.release_conn()
if code == 200:
return True
else:
@erdemarslan
erdemarslan / is64Bit.py
Created August 3, 2018 22:36
is computer x64 or x86
import os
def Is64Windows():
return 'PROGRAMFILES(X86)' in os.environ
def GetProgramFiles32():
if Is64Windows():
return os.environ['PROGRAMFILES(X86)']
else:
let filemanager = FileManager.default
var isDir : ObjCBool = false
let filename = "test"
let fileExtension = "txt"
var dir = try? filemanager.url(for: .cachesDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
dir!.appendPathComponent(filename)
@erdemarslan
erdemarslan / opencv_motion.py
Created September 8, 2018 18:54
Hareketli Nesneleri Sayma
import datetime
import math
import cv2
import numpy as np
#global variables
width = 0
height = 0
EntranceCounter = 0
ExitCounter = 0
@erdemarslan
erdemarslan / StringExtension.swift
Created September 10, 2018 21:37
Stringler ile ilgili kullanışlı extensionlarım
extension String {
// Zamana da çevir
func toDate() -> Date {
let df = DateFormatter()
df.dateFormat = "YYYY/MM/dd HH:mm"
if let date = df.date(from: self as String) {
return date
} else {
return df.date(from: "1970/01/01 00:00")!
}
@erdemarslan
erdemarslan / DateExtension.swift
Created September 10, 2018 21:38
Date ile ilgili kullanışlı extensionlarım
extension Date {
func hour() -> Int {
//Get Hour
let calendar = Calendar.current
let components = calendar.component(.hour, from: self as Date)
let hour = components.hashValue
//Return Hour
return hour
}
@erdemarslan
erdemarslan / UIColorExtension.swift
Created September 10, 2018 21:39
UIColor ile ilgili kullanışlı extensionlarım
import UIKit
extension UIColor {
func fromHex(_ hex : String) -> UIColor {
var hexString = hex.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines).uppercased()
if hexString.hasPrefix("#") {
hexString.remove(at: hexString.startIndex)
}
/*
* Biga İmam Hatip Ortaokulu
* YayaUyaran
*
* Proje Öğrencileri:
* Eslem Sare Kısa
* Emine Elif Elgin
*
*
*