Skip to content

Instantly share code, notes, and snippets.

View PRATAP-KUMAR's full-sized avatar
:octocat:

PRATAP PANABAKA PRATAP-KUMAR

:octocat:
View GitHub Profile
@bih
bih / MergeSort.markdown
Last active December 31, 2022 14:20
MergeSort Example in Ruby

MergeSort Algorithm in Ruby

When learning about sorting algorithms, I wanted to implement them to help me understand them better. This algorithm was originally invented by John von Neumann in 1948.

The Ruby script attached explains in real code what is going on. Play about with it.

How does the algorithm work?

Step by step:

  • Pass through an array of unsorted numbers (i.e. [4, 3, 2, 10])
@hedning
hedning / gnome-shell-record.py
Created January 18, 2020 14:21
Start gnome shell screen cast from command line
#!/usr/bin/env nix-shell
#! nix-shell -i python3 -p python3.pkgs.dbus-python
import dbus
import time
bus = dbus.SessionBus()
obj = bus.get_object("org.gnome.Shell", "/org/gnome/Shell/Screencast")
obj.Screencast("Auto %d %t.webm", [],
dbus_interface="org.gnome.Shell.Screencast")