Skip to content

Instantly share code, notes, and snippets.

View nikolak's full-sized avatar

Nikola Kovacevic nikolak

View GitHub Profile
@nikolak
nikolak / printer-prusa-mk3s-2021.cfg
Created July 23, 2021 18:03
Klipper MK3S/+ Config including optional Bondtech Extruder, Bear Extruder, etc.
# This file contains pin mappings and reasonable defaults for Prusa i3 MK3S
# printers. It will work with MK3 (non-S) by selecting the alternative filament
# sensor. References to common community mods are included as well.
#
# Note: The Einsy boards sold by Prusa have defective firmware on the
# usb-to-serial chip that makes the boards unusable with Klipper through USB.
# While flashing Klipper firmware must be done over USB, the board can be used
# via serial with no additional modification.
#
# To use this config, the firmware should be compiled for the AVR atmega2560.
@nikolak
nikolak / tk_search.py
Last active February 7, 2024 12:52
Filter tkinter listbox using Entry, StringVar and trace.
from Tkinter import *
# First create application class
class Application(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'threading_design.ui'
#
# Created: Thu Aug 6 13:47:18 2015
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
@nikolak
nikolak / events.json
Created November 7, 2014 11:42
Simple flask example that uses fullcalendar.io
[
{
"title": "All Day Event",
"start": "2014-09-01"
},
{
"title": "Long Event",
"start": "2014-09-07",
"end": "2014-09-10"
},
@nikolak
nikolak / craigslist_login.py
Last active November 17, 2021 22:00
Basic login to craigslist using python
import requests
# Some headers may bbe omitted, but IMO it's best to keep these:
headers = {"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36",
"Host": "accounts.craigslist.org",
"Origin": "https://accounts.craigslist.org",
"Referer": "https://accounts.craigslist.org/login"}
# form POST data

Keybase proof

I hereby claim:

  • I am nikolak on github.
  • I am nikolak (https://keybase.io/nikolak) on keybase.
  • I have a public key ASC9G0Rq2SdgijiTJHr6QaVr3mrkUJjbUKvumzIyNuxeoAo

To claim this, I am signing this object:

# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'design.ui'
#
# Created: Wed May 27 16:39:17 2015
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
#!/usr/bin/python
#
# Script Name: getRedditJSONSubmissionData.py
# Usage: ./getRedditJSONSubmissionData.py > redditData.json
# ----------------------------------------------------------------------------
# This script will average one request every two seconds.
# If the servers return data faster, you might
# need to change the sleep time to avoid going over the API limits.
# Also, make sure you change the settings in your Reddit account
# to get 100 objects at a time. You can also use the URL variable "limit=100"
@nikolak
nikolak / gist:8499032
Created January 19, 2014 01:02
Gets number of currently online friends on facebook
import webbrowser
import os
import urllib2
import json
import urllib
from time import strftime, sleep
def write_to_file(data):
if os.path.exists("fb_data.txt"):
with open("fb_data.txt","a") as out_file:
@nikolak
nikolak / trakt.py
Created June 1, 2014 15:19
Show a list of shows that are in user library that air in the next 7 days
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Nikola Kovacevic <nikola@nikolak.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