Skip to content

Instantly share code, notes, and snippets.

View flavius-popan's full-sized avatar

Flavius Popan flavius-popan

View GitHub Profile
@abishur
abishur / menu_launcher.py
Last active May 15, 2024 03:38
A simple menu system using python for the Terminal (Framebufer)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Topmenu and the submenus are based of the example found at this location http://blog.skeltonnetworks.com/2010/03/python-curses-custom-menu/
# The rest of the work was done by Matthew Bennett and he requests you keep these two mentions when you reuse the code :-)
# Basic code refactoring by Andrew Scheller
from time import sleep
import curses, os #curses is the interface for capturing key presses on the menu, os launches the files
screen = curses.initscr() #initializes a new window for capturing key presses
curses.noecho() # Disables automatic echoing of key presses (prevents program from input each key twice)
@Zulko
Zulko / 3D_piano_from_midi.py
Last active April 9, 2024 05:51
Turn a piano MIDI file into a basic 3D animated piano video.
"""
Turn a piano MIDI file into a basic 3D animated piano video.
See the result here:
I am leaving it as a script because it is not tested on enough MIDI files yet.
Zulko 2014
This script is released under a Public Domain (Creative Commons 0) licence.
@djmaze
djmaze / instructions.sh
Last active January 31, 2017 00:01
Docker w/GlusterFS volume driver on Scaleway C1 servers
# 0. For the server, use the "Docker" base image from the ImageHub (https://www.scaleway.com/de/imagehub/docker/)
# 1. Install https://github.com/calavera/docker-volume-glusterfs
# Alternatively, just download the prebuilt executable from https://gobuilder.me/get/github.com/calavera/docker-volume-glusterfs/docker-volume-glusterfs_master_linux-arm.zip
apt-get -y install golang
export GOPATH=~/go
go get github.com/calavera/docker-volume-glusterfs
mv go/bin/docker-volume-glusterfs /usr/local/bin/
# 2. Install GlusterFS
@edwardtoday
edwardtoday / backup-ghost-to-s3.sh
Last active May 5, 2017 19:20
Backup ghost blog related files to s3 bucket
#!/bin/bash
# create directories
rm -rf /tmp/ghost-backup
rm /tmp/ghost-backup*.tar.gz
mkdir -p /tmp/ghost-backup/
mkdir -p /tmp/ghost-backup/etc/
mkdir -p /tmp/ghost-backup/etc/nginx/
mkdir -p /tmp/ghost-backup/usr/local/etc/
mkdir -p /tmp/ghost-backup/var/www/ghost/content/
@vasanthk
vasanthk / System Design.md
Last active July 21, 2024 12:14
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@soupi
soupi / Json.hs
Last active November 11, 2019 19:34
A simple JSON EDSL
{- | An EDSL for defining and printing JSON values
-}
import Data.List (intercalate)
----------------
-- JSON Model --
----------------
-- | The JSONValue data type represents a JSON Value