Skip to content

Instantly share code, notes, and snippets.

View mnagy's full-sized avatar

Martin Nagy mnagy

  • Brno, Czech Republic
View GitHub Profile
#!/usr/bin/python
meno = input("Zadaj meno: ")
print(f"Ahoj, {meno}!")
meno_malym = meno.lower()
if meno_malym == 'martin':
print("Si dospely")
elif meno_malym == 'hanka' or meno_malym == 'sebastian':
print("Si dieta")
else:

Keybase proof

I hereby claim:

  • I am mnagy on github.
  • I am martin_nagy (https://keybase.io/martin_nagy) on keybase.
  • I have a public key ASAz8xIX5IkIeySvvB_y5FPFruHYeXwVZ_vI63RY6HVvGgo

To claim this, I am signing this object:

@mnagy
mnagy / money.py
Created October 20, 2015 11:25
Script to tell me how much I can spend untill the next payday
#!/usr/bin/python3
import sys
import datetime
def get_money():
try:
return int(sys.argv[1])
except (ValueError, IndexError):
#!/usr/bin/perl
use strict;
use warnings;
sub wait_for_project {
my $base_name = shift;
while (1) {
my $out = `oc get projects`;
if ($out =~ /($base_name-\w+)/) {
@mnagy
mnagy / $
Last active August 29, 2015 14:18
Put this in a bin directory. You can now copy&paste blocks of commands that have a dollar shell prompt prefixed.
#!/bin/bash
exec "$@"
@mnagy
mnagy / snake_cube.py
Created June 17, 2013 06:17
Script that solves the wooden snake cube puzzle.
#!/usr/bin/env python3
directions = [
(1, 0, 0), (0, 1, 0), (0, 0, 1),
(-1, 0, 0), (0, -1, 0), (0, 0, -1),
]
def new_position(position, direction, length):
length -= 1
@mnagy
mnagy / demangle_type_name.cc
Created September 14, 2012 13:41
Utility function for demangling C++ type names with RTTI
#include <cxxabi.h>
#include <stdlib.h>
#include <string>
#include <typeinfo>
std::string demangleTypeName(const char *name) {
int status;
char *realname;
std::string ret;