Skip to content

Instantly share code, notes, and snippets.

View dorukcan's full-sized avatar

Dorukcan Kişin dorukcan

View GitHub Profile
@dorukcan
dorukcan / bcp.py
Last active November 6, 2017 10:21
A simple clone of Boun Course Planner
# -*- coding: utf-8 -*-
import datetime
import re
import requests
from bs4 import BeautifulSoup
from sqlalchemy import *
"""
Güney Kampüs
@dorukcan
dorukcan / c0l0r.js
Last active December 14, 2017 10:03
if (!String.prototype.format) {
String.prototype.format = function () {
var args = arguments;
if (typeof arguments[0] === "object" && arguments.length === 1) {
args = arguments[0];
}
return this.replace(/{(\d+)}/g, function (match, index) {
return typeof args[index] !== 'undefined'
@dorukcan
dorukcan / CSV-Javascript.csv.js
Created December 23, 2017 13:45
intellij data extractor sqlite to mysql (for timestamps)
function eachWithIdx(iterable, f) {
var i = iterable.iterator();
var idx = 0;
while (i.hasNext()) f(i.next(), idx++);
}
function mapEach(iterable, f) {
var vs = [];
eachWithIdx(iterable, function (i) {
vs.push(f(i));
eksisozluk.com###videos
dizipub.com###video-oncesi
trakt.tv###huckster-desktop-wrapper
trakt.tv###charts-wrapper
trakt.tv###network-wrapper
trakt.tv###main-search
trakt.tv##a[href="/users/justkilled/year/*"] > .btn-dashboard.btn
trakt.tv##.stats-wrapper
; PSI Config File
;
; @category PHP
; @package PSI
; @author Michael Cramer <BigMichi1@users.sourceforge.net>
; @copyright 2009 phpSysInfo
; @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
; @version SVN: $Id: phpsysinfo.ini.new 705 2012-11-11 00:33:29Z namiltd $
; @link http://phpsysinfo.sourceforge.net
@echo off
for /f "skip=1 tokens=2 delims==" %%A in ('wmic /namespace:\\root\wmi PATH MSAcpi_ThermalZoneTemperature get CurrentTemperature /value') do set /a "HunDegCel=(%%~A*10)-27315"
echo %HunDegCel:~0,-2%.%HunDegCel:~-2% Degrees Celsius
def multiply_(num1, num2):
lines = []
len1 = len(num1)
len2 = len(num2)
for indice2 in range(0, len2):
line = ""
transfer = 0
for indice1 in range(0, len1):
@dorukcan
dorukcan / dizipub_podcast_feed.py
Created October 20, 2015 20:08
creates a podcast feed file for using in beyondpod podcast application
import urllib2
import re
from BeautifulSoup import BeautifulSoup
from feedgen.feed import FeedGenerator
DIZI_TITLE = "Six Feet Under"
DIZI_MAIN_URL = "http://dizipub.com/dizi/six-feet-under-tum-bolumler-izle"
DIZI_LOGO = "http://images.popmatters.com/news_art/s/six-feet-under.jpg"
def downloadUrl(url):
def make_turkish(text, encode=False):
"""
Transforms a broken text to nice unicode equivalent.
:param text: Text to modify
:param encode: Boolean value indicates that whether encode the text to utf-8 or not
:return: Modified text
"""
if not text:
@dorukcan
dorukcan / twitch_chat_badge.js
Created March 13, 2019 17:37
hide non-badged chat comments
function handle_chat() {
Array.from(document.querySelectorAll('.video-chat__message-list-wrapper li')).filter(x => {
return x.querySelectorAll('[data-a-target="chat-badge"]').length === 0;
}).forEach(x => {
x.setAttribute('style', 'display: none');
});
}
function start_observation() {
// Select the node that will be observed for mutations