Skip to content

Instantly share code, notes, and snippets.

ritiek /
Created Jun 3, 2019
Start a track on instances of mpv on different machines at the same time using mpv's IPC server with socat
# mpv --idle --no-video --loop --input-ipc-server=/tmp/mpvsocket
# socat /tmp/mpvsocket udp4-listen:5000,reuseaddr,fork
ritiek /
Last active May 7, 2019
Compiling source with static and shared library
// bin_hello.cpp

#include "lib_hello.h"

int main() {
ritiek /
Last active Mar 31, 2019
A simple (py)game with purposely messed code to teach important programming concept to newbies
import pygame
import random
width, height = (450, 600)
background_color = (10,10,10)
clock = pygame.time.Clock()
screen = pygame.display.set_mode((width, height))
pygame.display.set_caption("Falling Blocks")
ritiek / bot.au3
Created Nov 3, 2018
chrome t-rex game bot
View bot.au3
HotKeySet("{F10}", "Exitter")
While 1
$color = PixelGetColor(545,229)
If $color = 5460819 Then
Send("{DOWN UP}")
Send("{UP DOWN}")
Send("{UP UP}")
ritiek /
Created Aug 11, 2018
Google Summer of Code 2018 Final Report

Google Summer of Code 2018 Final Report

My original project - to create a factory based implementation for unifying handling of different types of Plasmas, was completed sooner than expected. Here are the link to related pull requests I made during the summer.

PR Status Description
#501 Merged Raise more fitting NotImplementedError for functions that are yet to be implemented in our Plasma metaclass
#489 Merged Ind
ritiek /
Last active Sep 12, 2020
Convert a track to nightcore
# Increase tempo (x1.06) and frequency (x1.25 assuming input freq. = 44100 Hz)
ffmpeg -i input.mp3 -filter:a "atempo=1.06,asetrate=44100*1.25" output.mp3
# Without tempo
ffmpeg -i input.mp3 -filter:a "asetrate=44100*1.25" output.mp3
# Create one frame .mp4 from .mp3 + .jpg
ffmpeg -i output.mp3 -i anime.jpg output.mp4
# Do above in single command
ffmpeg -i input.mp3 -i anime.jpg -filter:a "atempo=1.06,asetrate=44100*1.25" -vn output.mp4
ritiek /
Created Jun 6, 2018
Fork all your starred repositories to an organization you own
from github import Github
g = Github(TOKEN)
organ = g.get_organization(ORGANIZATION)
user = g.get_user()
for repo in user.get_starred():
ritiek /
Last active Mar 25, 2019
My OpenAstronomy GSoC 2018 Application
ritiek /
Last active Apr 28, 2019
Fetch information from wolfram and wikipedia using Flask API
import wolframalpha
import wikipedia
from wikipedia.exceptions import DisambiguationError
from flask import Flask
app = Flask(__name__)
client = wolframalpha.Client('T27H46-H3TH6GL545')
def wolframit(query):
ritiek /
Last active Dec 19, 2018
Count number of lines of code in a project
find . -name "*.py" -type f -exec grep . {} \; | wc -l