Skip to content

Instantly share code, notes, and snippets.

:octocat:
coding

Selim Ozturk selimslab

:octocat:
coding
View GitHub Profile
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 pandas.py
pd.set_option('display.max_rows', 50)
pd.options.display.max_colwidth = 140
df = df.drop(columns='days')
df = pd.merge(df, counts, on='model')
df = df.sort_values('count', ascending=False)
View curl.sh
curl -Is www.google.com | head -1
# HTTP/1.1 200 OK
@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 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 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 fuzzy.py
from fuzzywuzzy import process, fuzz
def match_by_fuzzy_string_search(
possible_matches: List[str], string_to_be_searched: str
) -> str:
scores = dict()
for candidate in possible_matches:
n = len(candidate.split())
n_grams = generate_ngrams(string_to_be_searched, n)
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):
You can’t perform that action at this time.