Skip to content

Instantly share code, notes, and snippets.

@keremistan
keremistan / sliderButtons.tsx
Created March 18, 2021 08:54
Left and right slider buttons.
const PIXELS_TO_BE_SLIDED = 1000;
type ISliderButton = {
toRight: boolean;
className: string;
}
export function RightSliderButton({ className }: { className: string }) {
return <SliderButton toRight={true} className={className} />
}
@keremistan
keremistan / absolutePositioningWithHigherHTML.tsx
Created March 18, 2021 08:51
A absolute positioning sample where HTML is moved a level higher.
const useStyles = makeStyles({
correctSlidersWrapper: {
display: 'flex',
alignItems: 'center',
position: 'relative',
'&__rightButton': {
position: 'absolute',
right: '0',
},
'&__leftButton': {
@keremistan
keremistan / absolutePositioning.tsx
Created March 18, 2021 08:49
A sample for absolute positioning is used.
const useStyles = makeStyles({
absPosedWrapper: {
position: 'relative',
'&__rightButton': {
position: 'absolute',
right: 0,
},
'&__leftButton': {
position: 'absolute',
left: 0,
@keremistan
keremistan / fixedPositioning.tsx
Created March 18, 2021 08:47
A sample where fixed positioning is used.
const useStyles = makeStyles({
fixedToPageWrapper: {
position: 'relative',
'&__rightButton': {
position: 'fixed',
right: 0,
},
'&__leftButton': {
position: 'fixed',
left: 0,
@keremistan
keremistan / getOneRandomColor.ts
Created March 18, 2021 08:42
Getting one random color.
function getRandomColor(): string {
// source: <https://stackoverflow.com/a/5365036/6656967>
return "#" + ((1 << 24) * Math.random() | 0).toString(16);
}
@keremistan
keremistan / getRandomColors.ts
Created March 18, 2021 08:41
Getting 10 random colors.
function get10RandomColors(): string[] {
return Array.from({ length: 10 }, () => getRandomColor());
}
from os import path, getcwd, mkdir, walk
from shutil import copy2, copyfile
def klasorleri_gez(kynk, hdf):
butun_icerik = walk(kynk, False)
butun_icerik_liste = [i for i in butun_icerik]
for i in range(len(butun_icerik_liste)):
klasor = butun_icerik_liste[i]
klasor_adresi = klasor[0]
@keremistan
keremistan / structurel_induction_example.py
Created November 26, 2019 16:22
A python program that finds possible solutions for a given function in propositional calculus. This program checks automatically all the combinations whether there are suitable combinations for variables that validate the new formel. That is best used in the induction step (Induktionsschritt in German) in a structural induction (Strukturelle Ind…
# To decipher the result,
# 0 -> theta
# 1 -> not theta
# 2 -> psi
# 3 -> not psi
def and_op(theta, psi):
return theta and psi
def or_op(theta, psi):
@keremistan
keremistan / draw_map.py
Created June 11, 2018 19:17
Using folium, create a map and mark the given coordinates
import folium
# map function gets location, zoom and tiles
berlin = folium.Map(location=[52.49, 13.36])
# geo_locations.txt file is where the coordinates are. For example: Mitte,52.5295114,13.384034
file = open("/Users/kerem/Desktop/geo_locations.txt", "r")
content = file.read().split('\n')
coords_of_addresses = []
@keremistan
keremistan / usecase.wsd
Created May 17, 2018 21:20
Basic Usecase Diagram with Plantuml
@startuml
(Hesap Girme) as hg
usecase "Hesap Silme" as hs
usecase "Sirket Batir" as sb
:Calisan: as ca
actor Mudur as md
ca -> hs