Skip to content

Instantly share code, notes, and snippets.


Konstantin Farrell konstantinfarrell

View GitHub Profile
konstantinfarrell / foo.js
Last active Sep 5, 2019
Google scraper stuff
View foo.js
var scraper = require("google-play-scraper")
// get a list of apps
var apps ={
term: "foo",
num: 100,
var meta = []
konstantinfarrell / web.html
Last active Sep 9, 2017
A neat graph/web animation using p5.js
View web.html
<!DOCTYPE html>
<script src=""></script>
body {
margin: 0;
overflow-x: hidden;
overflow-y: hidden;
konstantinfarrell /
Last active Mar 11, 2017
Is Massive broken because of that stupid database file? Use this. Python 3.6
import os
def fix_massive():
user = os.getlogin()
shit = rf'C:\Users\{user}\AppData\Local\Native Instruments\Massive\NIMassiveDataBase_ul'
if os.path.exists(shit):
konstantinfarrell /
Last active Jul 7, 2016
What originally was meant to be a quick script to determine how much total XP is needed to reach a certain level turned into an exercise showing the value of knowing the summation formula rather than simply going for the brute-force method
import timeit
import math
def total_xp(level):
Uses a loop to compute the total amount of xp
needed to reach a certain level.
total = 0
import os
def fibonnacci(num):
Takes a number num and returns the num'th fibonnacci number.
if num == 2 or num == 1:
return 1
fib = fibonnacci(num-1) + fibonnacci(num-2)
konstantinfarrell /
Last active Jul 3, 2016
Recursive directory walk function in Python.
import os
def directory_walk(path):
for item in os.listdir(path):
if os.path.isdir(item):
konstantinfarrell /
Created Jun 28, 2016
FizzBuzz one-liner in Python 3
# Using a lambda function
print(list(map(lambda i: "Fizz"*(i%3==0)+"Buzz"*(i%5==0) or str(i), range(1,101))))
# Using a for loop
for i in range(1, 101): print("Fizz"*(i%3==0)+"Buzz"*(i%5==0) or str(i))
konstantinfarrell /
Last active Jun 14, 2016
Query a stock symbol with the python requests library
import requests
querystring = API_URL + "?s=" + symbol + "&f=" + params
konstantinfarrell /
Created May 29, 2016
Python script that cleans up my downloads folder
import shutil
import mimetypes
from os import listdir
from os.path import isfile, join
ORIGIN = r"C:\Users\Konstantin\Downloads\\" # Change these. Unless your system
# happens to have the same configuration.
MUSIC_DESTINATION = r"C:\Users\Konstantin\Music\\"
PICTURE_DESTINATION = r"C:\Users\Konstantin\Pictures\\"
PDF_DESTINATION = r"C:\Users\Konstantin\Documents\\"
konstantinfarrell / cube_error.ino
Created May 14, 2016
Arduino code to translate HTTP error messages into LED patterns on a 3x3x3 LED matrix.
View cube_error.ino
// we're gonna try something new here.
int scannow=0,scandir=0;
int incoming = 0;
unsigned int table[][4]={
{0x000, 0x000, 0x000, 0x0000},
void setup() {