Skip to content

Instantly share code, notes, and snippets.

View nikolak's full-sized avatar

Nikola Kovacevic nikolak

View GitHub Profile
@nikolak
nikolak / gist:8765020
Created February 2, 2014 09:04
Make a dictionary with subreddits as keys and values as upvotes and downvotes in that subreddit, works for last ~1000 comments
#!/usr/bin/env python
import sys
import json
import time
import urllib
import httplib2
from urllib import urlencode
from urlparse import urlparse, urlunparse, parse_qs
import datetime
import time
alarm = datetime.datetime(2014, month, day, hour, minute)
while True:
now = datetime.datetime.now()
diff = alarm - now
if diff.total_seconds() < 0:
print "Alarm triggered"
break
import os
import sys
from PySide import QtGui, QtCore
class MainWindow(QtGui.QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.showFullScreen()
def quicksort(array):
if len(array) <= 1:
return array
pivot = array[0]
array.remove(pivot)
less, greater = [], []
for x in array:
if x <= pivot:
less.append(x)
else:
@nikolak
nikolak / trakt_ep_to_sickrage.py
Last active August 29, 2015 14:07
Syncs all episodes from trakt.tv library to local sickrage database
import requests
import sqlite3
import os
'''
Status ID's:
1 = not aired
3 = wanted
5 = skipped
@nikolak
nikolak / res.py
Created October 24, 2014 19:11
Convert RES settings to chrome extension data from firefox settings and vice versa.
import os
import ConfigParser
import json
import sqlite3
import codecs
def _expand(path):
return os.path.expanduser(path)
@nikolak
nikolak / README.md
Last active August 29, 2015 14:17 — forked from timothyandrew/README.md

Introduction

  • This script lets you set up and use a temporary DigitalOcean droplet to download torrent files.
  • Once downloaded, they can be streamed down to your local machine.
  • This uses transmission-cli for the torrent client, and nginx to serve files.

Setup on Local Machine

  • This assumes that you have a DigitalOcean account and tugboat set up, as well as seedbox-setup.sh present in the current directory.
@nikolak
nikolak / m.md
Last active August 29, 2015 14:26

General

  • Django 1.7 EOL ~1yr after product release (1.8 is LTS) - migration should be easy docs
  • Testing - planned? Core features should be covered before release.
  • Moving controllers into their own apps?
  • Performance overhead by generating new dicts all the time? Maybe stroing json or using serialization? docs
  • Approach the communication between frontend and backend as a RESTful API that it is. Create API specs and docs. Suggestion: http://swagger.io/ some tool overview

Code

@nikolak
nikolak / bot.py
Created March 9, 2013 17:26
contest_mode_bot
#!/usr/bin/env python
# Copyright (c) 2013 Nikola Kovacevic <nikolak@outlook.com>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@nikolak
nikolak / gist:5192057
Created March 18, 2013 23:41
Links for software mentioned here: http://redd.it/1aiter