Skip to content

Instantly share code, notes, and snippets.

View dorukcan's full-sized avatar

Dorukcan Kişin dorukcan

View GitHub Profile
@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 / login to eksisozluk.com.py
Created February 15, 2015 10:58
login to eksisozluk.com and work on the members-only stuff
import urllib, urllib2, cookielib, re
def login(email, password):
#giriş için gerekli ek değişkenler
returnUrl = '/'
rememberMe = 'true'
hiddenToken = ''
#request değişkenlerinin ilklendirilmesi
cj = cookielib.CookieJar()
@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 / 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)
var alphabet = "ABCDEFGHIJKLMONPQRSTUVWXYZ ",
target = "METHINKS IT IS LIKE A WEASEL",
i, score = 0, copies, gen = 0, child = "";
String.prototype.replaceAt = function(index, character) {
return this.substr(0, index) + character + this.substr(index+1);
}
String.prototype.shuffle = function() {
var i = this.length, j, temp = this;
@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 / gist:9e570892156b65ed9015
Created October 4, 2014 09:58
episodecalendar.com to trakt.tv
import requests
import hashlib
import json
def markaswatched():
"""
marks episodes which are marked on episodecalendar as seen on trakt. because episodecalendar forced me to buy premium version. fuck you episodecalendar.
http://trakt.tv/api-docs/show-episode-seen
"""