Skip to content

Instantly share code, notes, and snippets.

@korayal
korayal / netblocks.py
Last active November 13, 2022 16:04
Netblocks
#
# First install python-playwright via: `pip3 install playwright && playwright install`
#
from playwright.sync_api import sync_playwright
from datetime import datetime, timedelta
import time
with sync_playwright() as p:
browser = p.chromium.launch(headless=True)
page = browser.new_page()
@korayal
korayal / check_3d.py
Last active August 23, 2022 16:03
Check whether a video file is 3d
#! /usr/bin/env nix-shell
#! nix-shell -i python3 -p python39Packages.pillow -p python39Packages.numpy
from PIL import Image
import numpy as np
import subprocess
import argparse
from decimal import *
import time
import glob
@korayal
korayal / singletons.hs
Last active July 23, 2020 23:02
testing for singletons
#! /usr/bin/env nix-shell --
#! nix-shell -p ghcid -p "haskellPackages.ghcWithPackages (pkgs: with pkgs; [singletons])" -i "ghcid -c 'ghci -Wall' -T main"
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
#! /usr/bin/env nix-shell
#! nix-shell --pure -i runghc -p "haskellPackages.ghcWithPackages (pkgs: [ pkgs.aeson pkgs.validation pkgs.ghcid pkgs.errors ])"
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
import Control.Error (fmapL)
import Control.Error.Util
import Data.Aeson
import requests
from bs4 import BeautifulSoup
from urllib.parse import quote
import datetime
from pathlib import Path
# make sure this directory exists
dl_root = '/tmp/cenaze/'
target_url = 'https://www.turkiye.gov.tr/inegol-belediyesi-vefat-sorgulama'
# install beautifulsoup4, requests, lxml
import re
import json
from pathlib import Path
from urllib.parse import urlencode
import requests
from bs4 import BeautifulSoup
# your user hash and token for Pushover
user = '<user>'
# Parent Assessment at "Raising An Emotionally Intelligent Child"
# your answers to the questions at http://media1.razorplanet.com/share/510260-9563/resources/1084755_Parent.Assessment.docx
a = {'1': False, '2': True}
def countTrues(trues, answers, divider):
return len(list(filter(lambda x: x[0] in trues and x[1], answers.items()))) / divider
# Dismissing (divide by 25)
@korayal
korayal / atama.py
Created June 5, 2017 10:06
Ankara MEB Atama Takibi
# ankara.meb.gov.tr ilanlarina bakip, icinde sonuc gecen ilan ciktiginda Pushover uzerinden bildirim gonderir.
#!/usr/bin/env python3
import requests
from bs4 import BeautifulSoup
from pushover import init, Client
import re
from pathlib import Path
from datetime import datetime, timedelta
@korayal
korayal / meb.js
Last active May 25, 2017 13:25
MEB Ogretmen atamalari icin okul secme aparati
/*
1) Asagidaki kodda `a` degiskenini tercih listenizin sirasina gore duzenleyin. 6 haneli
okul numaralarinin son basamagina fazladan bir `0` daha ekleyin. Orn: 123456 -> 1234560
2) Chrome veya benzeri bir modern tarayici ile Mebbis'e giris yapip atama sayfasina gelin.
3) F12'ye basarak konsolu acin.
4) Guncellediginiz asagidaki kodu yappistirip enter'a basin.
5) Dua edin.
6) Afiyet olsun.
*/
// okul no listesi (sonuna 0 eklemeniz gerekiyor)
@korayal
korayal / .cvimrc
Created December 21, 2015 12:08 — forked from calorie/.cvimrc
.cvimrc
set nocncpcompletion
set nosmoothscroll
set nohud
set noregex
set noinsertmappings
set noautoupdategist
set typelinkhints
set defaultnewtabpage
let scrollduration = 10
let searchlimit = 40