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.

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:

def check_for_airpods(timeout=60):
import time;import os;import requests;import arrow
while True:
status = requests.get("https://www.apple.com/de/shop/retail/pickup-message?parts.0=MMEF2ZM%2FA&location=81925").json()['body']['stores'][0]['partsAvailability']['MMEF2ZM/A']['storePickupQuote']
available = 'Aug im' not in status
if available:
os.system(""" osascript -e 'display notification "{}" with title "Apple Store AirPods"'""".format(status))
else:
print(f"Last checked at {arrow.now().format('YYYY-MM-DD HH:mm')}, status= {status}", end="\r")
time.sleep(timeout)
def letter_count(s):
counter, max_index = 1, len(s) - 1
out = []
for index, letter in enumerate(s):
if index < max_index:
if letter == s[index + 1]:
counter += 1
continue
# -*- 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 / threading_design.ui
Created August 5, 2015 20:44
Qt Designer files for http://nikolak.com/ tutorial [insert tutorial link here]
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>526</width>
<height>373</height>
@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

# -*- 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
@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
@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.