Skip to content

Instantly share code, notes, and snippets.

View dorukcan's full-sized avatar

Dorukcan Kişin dorukcan

View GitHub Profile
@dorukcan
dorukcan / eksi channel.js
Last active August 29, 2015 14:14
ekşi: set title channel
//these codes go to developer console of https://tr.wikipedia.org/wiki/Kategori:ABD%27li_kad%C4%B1n_pop_%C5%9Fark%C4%B1c%C4%B1-s%C3%B6z_yazarlar%C4%B1
var titles = [];
$('#mw-pages .mw-content-ltr li>a').each(function(){
titles.push( $(this).attr('title').replace( new RegExp(" \\(.*?\\)","gm"), '') );
});
arr.join();
//these codes go to any page of https://eksisozluk.com
var titles = "Eric Adams,Akon,Alan Arkin".split(','),
@dorukcan
dorukcan / sort buddies.js
Last active August 29, 2015 14:15
sort buddies on ekşi sözlük
//run at console of https://eksisozluk.com/badi-engellenmis
$('head').append('<script type="text/javascript" src="https://mottie.github.io/tablesorter/js/jquery.tablesorter.js"></script>');
$('head').append('<link rel="stylesheet" type="text/css" href="https://mottie.github.io/tablesorter/css/theme.default.css">');
var badilist = [];
$('.relation-list').eq(0).find('a[href*=biri]').each(function(){
badilist.push($(this).attr('href'));
});
@dorukcan
dorukcan / nppbackup.py
Created February 27, 2015 23:01
clear notepad++ backup files
import os
def main():
path = "C:\Users\Doruk\Desktop\NPP_BACKUP\\"
files = os.listdir(path)
before = files[0]
count = 0
@dorukcan
dorukcan / yemeksepeti_price_sort.js
Created October 22, 2015 19:26
sorts products by price on yemeksepeti.com
// ==UserScript==
// @name Yemeksepeti
// @namespace https://*.yemeksepeti.com/*
// @version 0.1
// @description sorts products by price on yemeksepeti.com
// @author dorukcan kişin
// @author https://twitter.com/johnpaulziller
// @grant none
// ==/UserScript==
@ECHO OFF
cd %~dp1
ECHO Compiling %~nx1.......
IF EXIST %~n1.class (
DEL %~n1.class
)
javac %~nx1
IF EXIST %~n1.class (
ECHO -----------OUTPUT-----------
java %~n1
@dorukcan
dorukcan / followings who write most at recent 1000 tweet.py
Last active February 13, 2016 14:41
followings who write most at recent 1000 tweet
from twython import Twython
def main():
APP_KEY = ""
APP_SECRET = ""
OAUTH_TOKEN = ""
OAUTH_TOKEN_SECRET = ""
twitter = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
my_timeline = twitter.get_home_timeline(count = 200)
@dorukcan
dorukcan / auto_install_windows_updates.au3
Last active April 20, 2016 14:20
Runs windows update standalone files which have been downloaded by http://www.windowsupdatesdownloader.com/
#include <File.au3>
#RequireAdmin
Local $location = "C:\Users\dorukcan\Documents\Windows Updates Downloader\Non-Security Updates\"
Local $aFileList = _FileListToArray($location, "*")
For $i = 1 To $aFileList[0]
;open file
ShellExecute($location & $aFileList[$i])
ConsoleWrite($i & " " & $aFileList[$i] & @CRLF)
import urllib2, json, sqlite3
from peewee import *
def getSummonerId(name, api_key):
url = "https://euw.api.pvp.net/api/lol/euw/v1.4/summoner/by-name/" + name + "?api_key=" + api_key
data = urllib2.urlopen(url).read()
jsonData = json.loads(data)
return jsonData[name.lower()]["id"]
def getMatches(s_id, region, api_key):
//MODULE TRANSFER
var result = [];
jQuery("#system-modules fieldset").each(function() {
jQuery(this).find(".form-checkbox").each(function() {
result.push([jQuery(this).attr("id"), jQuery(this).attr("checked")]);
});
});
console.log(JSON.stringify(result))
values = [];
for (i = 2; i <= 14; i++) {
$.get("https://www.ayrintiyayinlari.com.tr/ucuzlatilmis-kitaplar/s/" + i, function(data) {
var html = $.parseHTML(data);
$(html).find(".span9 .editor .box").appendTo(".span9 .editor>div:eq(0)");
});
}
//---------------------------------------------------------------------------------------------------------------------------
var arr = $(".box").get();