Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
coding

Selim Ozturk selimslab

:octocat:
coding
View GitHub Profile
@selimslab
selimslab / dataclass.py
Last active Jul 27, 2019
new python features
View dataclass.py
from dataclasses import dataclass
@dataclass
class Armor:
armor: float
description: str
level: int = 1
def power(self) -> float:
return self.armor * self.level
View heavn.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no" />
<title>TCO Tool</title>
<!-- CSS -->
<link href="css/style.css" type="text/css" rel="stylesheet" media="screen,projection" />
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Quattrocento Sans">
@selimslab
selimslab / sensor.c
Last active Aug 7, 2019
TSL-2561 light sensor library for Nordic nRF 51822
View sensor.c
#include < stdio.h >
#include "boards.h"
#include "app_util_platform.h"
#include "app_uart.h"
#include "app_error.h"
#include "nrf_drv_twi.h"
#include "nrf_delay.h"
#include "main.h"
/* Define version of GCC. */
View follower.js
follow_buttons = $$('[data-testid$="follow"]')
follow_buttons.forEach(button => button.click())
console.log(unfollow_button)
following = $$('div[data-testid="UserCell"]')
following.forEach(
f => {
if (!f.textContent.includes("Follows you")) {
unfollow_button = f.querySelector('[data-testid$="-unfollow"]')
View chan.py
""" Generate create, update, and delete operations for products
Author: Selim Ozturk
Created: Sep 18, 2019
Licence: MIT
Last Edited: Sep 19, 2019
"""
import os
import csv
from typing import List, Tuple, Iterator
View time.py
from datetime import datetime, timedelta
TODAY = datetime.now().date().isoformat()
def get_date_of_x_days_ago(x: int):
return (datetime.now().date() - timedelta(days=x)).isoformat()
def str_to_date(s: str):
View regex.py
import re
def remove_digits(word):
return re.sub("\d+", "", word)
def find_n_digits_only(n, word):
return re.findall(r"\d" + "{" + str(n) + "}", word)
View inorderTraversal.py
"""
Input: [1,null,2,3]
1
\
2
/
3
Output: [1,3,2]
"""
View class.sc
trait Bark {
def bark: String = "Woof"
}
trait Dog {
def breed: String
def color: String
}
class SaintBernard extends Dog with Bark {
val breed = "Saint Bernard"
val color = "brown"
View abstractClass.java
import java.util.*
// Abstract class is only meant to serve as a base or blueprint for connecting the subclasses that inherit (extend) it.
// using a machine without knowing its internals
abstract class Book {
String title;
String author;
You can’t perform that action at this time.