Skip to content

Instantly share code, notes, and snippets.

View macobo's full-sized avatar
🚀

Karl-Aksel Puulmann macobo

🚀
View GitHub Profile
{
"metadata": {
"name": "Praks8"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
{
"metadata": {
"name": "Praks8"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@macobo
macobo / gist:7150093
Created October 25, 2013 06:10
Praks 8, friday
{
"metadata": {
"name": "Praks8"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@macobo
macobo / gist:7150520
Last active December 26, 2015 12:19
Reedene praks
{
"metadata": {
"name": "Reede-Praks8"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
from turtle import *
from math import sin, cos
def pooltelg(pikkus, samm):
i = 0
while i < pikkus:
i += 1
forward(samm)
right(90)
forward(5)
{
"metadata": {
"name": "Praks12"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
from turtle import *
def eksruut(kylg, tasemeid):
if tasemeid > 0:
right(180)
for i in range(4):
forward(kylg)
right(90)
eksruut(kylg/2, tasemeid-1)
right(180)
@macobo
macobo / vpl_evaluate.sh
Created April 23, 2014 12:39
Moodle integration for grader module (https://github.com/macobo/python-grader)
#!/bin/bash
printf '#!/bin/bash\n' > vpl_execution
printf 'PATH=$PATH:/usr/local/bin\n' >> vpl_execution
printf 'export PYTHONIOENCODING=utf-8\n' >> vpl_execution
printf 'source vpl_environment.sh\n' >> vpl_execution
printf 'python3 vpl_grader.py\n' >> vpl_execution
chmod +x vpl_execution
@macobo
macobo / puller.py
Last active July 25, 2017 22:30 — forked from thoas/puller.py
#!/usr/bin/env python
import getopt
import sys
from sqlalchemy import create_engine, MetaData, Table
from sqlalchemy.dialects.mysql.base import TINYINT
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.exc import ProgrammingError
@macobo
macobo / when-changed
Created December 10, 2014 16:35
Put this into /usr/bin and enjoy!
#!/usr/bin/env python
"""%(prog)s - run a command when a file is changed
Usage: %(prog)s [-r] FILE COMMAND...
%(prog)s [-r] FILE [FILE ...] -c COMMAND
FILE can be a directory. Watch recursively with -r.
Use %%f to pass the filename to the command.
Copyright (c) 2011, Johannes H. Jensen.