Skip to content

Instantly share code, notes, and snippets.

View emrepun's full-sized avatar

emrepun emrepun

  • Munich
View GitHub Profile
@emrepun
emrepun / EasyTimersWithText.swift
Created October 10, 2024 12:19
SwiftUI Easy Timers with Text
import SwiftUI
struct ContentView: View {
@State var startDate: Date = .now
@State var countDownEndDate: Date?
var body: some View {
VStack(spacing: 16.0) {
Text("Duration:")
@emrepun
emrepun / PreciseTimerExample.swift
Created October 3, 2024 08:40
Precise Timer Example in SwiftUI
import SwiftUI
struct ContentView: View {
@State var startDate: Date?
var body: some View {
TimelineView(MetricsTimelineSchedule(from: .now)) { _ in
VStack(spacing: 16.0) {
ElapsedTimeView(elapsedTime: elapsedTime())
@emrepun
emrepun / german-driving-license.md
Created February 19, 2022 21:52 — forked from blessanm86/german-driving-license.md
Quick Ref Notes for German Driving License Test

What are the consequences for a person driving a motor vehicle under the influence of drugs (e.g. hashish, heroin, cocaine)?

[x] Confiscation of driving licence or driving ban
[x] Compulsory medical/psychological examination
[x] Fine and/or imprisonment

In which instances do you have to approach a pedestrian crossing with particular care?

[x] If pedestrians want to cross the road

[x] If the view of the pedestrian crossing is restricted

@emrepun
emrepun / jsonDataSample.swift
Created January 15, 2021 10:31
jsonDataSample
//
// JSONData.swift
// CompareCoreDataFileManager
//
// Created by Emre Havan on 09.10.20.
// Copyright © 2020 Emre Havan. All rights reserved.
//
import Foundation
@emrepun
emrepun / EnumJsonParsing.swift
Created February 3, 2020 20:31
Parse json item array (consists of different items) with enums & associated values
import Foundation
struct GeometricShapes: Decodable {
let items: [Object]
}
enum Object: Decodable {
case square(Square)
case sphere(Sphere)
case cylinder(Cylinder)
import numpy as np
import pandas as pd
import json
import pickle
import re
from nltk.corpus import stopwords
from nltk.stem.porter import PorterStemmer
class ReviewClassifierService:
@emrepun
emrepun / recommender_engine_version_4.py
Created December 8, 2019 23:24
merged_engine_3.py
# Version-4
def get_recommendations_include_rating_count_threshold_positive_negative_reviews(keywords):
df = pd.read_csv('city_data_cleared.csv')
score_dict = {}
for index, row in df.iterrows():
cs_score = CosineSimilarity.cosine_similarity_of(row['description'], keywords)
rating = row['rating']
@emrepun
emrepun / recommender_engine_version3_method.py
Created December 8, 2019 23:21
merged_recommender_engine_2.py
# Version-3
def get_recommendations_include_rating_count_threshold(keywords):
df = pd.read_csv('city_data_cleared.csv')
score_dict = {}
for index, row in df.iterrows():
cs_score = CosineSimilarity.cosine_similarity_of(row['description'], keywords)
rating = row['rating']
@emrepun
emrepun / recommender_engine_version2_method.py
Last active December 8, 2019 23:29
merged_engine_1.py
import numpy as np
import pandas as pd
from cosine_similarity import CosineSimilarity
from rating_extractor import RatingExtractor
import operator
import json
class RecommenderEngine:
def __init__(self):
print("engine initialized")