Skip to content

Instantly share code, notes, and snippets.

View pbanaszkiewicz's full-sized avatar

Piotr Banaszkiewicz pbanaszkiewicz

View GitHub Profile
class Job(object):
@require_perms("create_vm")
@staticmethod
def create_vm(**data):
pass
# ... somewhere else ...
with permissions(current_user.perms):
job = Job.create_vm()
@pbanaszkiewicz
pbanaszkiewicz / gist:11292070
Created April 25, 2014 14:45
Peer instruction on the Web - an accepted proposal for Mozilla (Google Summer of Code 2014)

Peer instruction on the Web

Abstract

Currently no MOOCs (Massive Open Online Courses) or e-learning systems support a peer instruction method, which has shown some advantages over traditional lecture-based learning techniques. In this project I will implement a tool that helps instructors and their students experiment with this teaching method online. The project will mainly leverage WebRTC technology.

@pbanaszkiewicz
pbanaszkiewicz / linode_config.js
Created June 1, 2014 21:48
Lynckia's Linode configuration file, for use with Peer Instruction (https://github.com/pbanaszkiewicz/peer-instruction)
var config = {}
config.rabbit = {};
config.nuve = {};
config.erizoController = {};
config.cloudProvider = {};
config.erizo = {};
config.rabbit.host = 'localhost';
config.rabbit.port = 5672;
@pbanaszkiewicz
pbanaszkiewicz / gist:2517d29e9ff0c9a0f744
Created August 15, 2014 21:29
Sublime User preferences
{
"always_show_minimap_viewport": true,
"auto_indent": true,
"bold_folder_labels": true,
"close_windows_when_empty": false,
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"detect_indentation": true,
"draw_minimap_border": true,
"enable_telemetry": false,
"folder_exclude_patterns":
def get_db():
ctx = _app_ctx_stack.top
con = getattr(ctx, "sa_database", None)
if con is None:
con = SQLAlchemy(ctx.app)
ctx.sa_database = con
return con
@pbanaszkiewicz
pbanaszkiewicz / gsoc_visa_exchange.py
Last active October 9, 2015 12:38
Quickly look up conversion rates (GSOC, VISA, PLN, USD, 3% bank fee)
#!/usr/bin/env python
import requests
from datetime import date
import re
def main():
url1 = "http://corporate.visa.com/pd/consumer_services/consumer_ex_rates.jsp"
url2 = "http://corporate.visa.com/pd/consumer_services/consumer_ex_results.jsp"
@pbanaszkiewicz
pbanaszkiewicz / turn_off.py
Created October 13, 2012 11:26
Turn the computer off after specified time. Show notifications.
#!/usr/bin/env python
# coding: utf-8
import os
import datetime
import time
import pynotify
MAX_UPTIME = 60 * 60 # in seconds: 1 hour
{% extends "workshops/_page.html" %}
{% block content %}
<h2>Instructors</h2>
{% if instructors %}
<p><span class="glyphicon glyphicon-envelope"></span> = mail instructor about problem</p>
<p><span class="glyphicon glyphicon-remove"></span> = no email address available</p>
<table class="table table-striped">
<tr>
<th>Instructor</th>
import numpy as np
import pylab as plt
from scipy.fftpack import fft, ifft, fftfreq
from scipy.io import wavfile
from scipy.signal import butter, filtfilt, lfilter
filename = 'probka2.wav'
filename_out = 'probka2_filtered.wav'
[fs, frames] = wavfile.read(filename)
@pbanaszkiewicz
pbanaszkiewicz / gist:5178702
Last active December 15, 2015 01:18
Swearing sudo
$ sudo /bin/false
[sudo] password for piotr:
There must be cure for it!
[sudo] password for piotr:
And with that remarks folks, the case of the Crown vs yourself was proven.
[sudo] password for piotr:
Where did you learn to type?
sudo: 3 błędne próby wprowadzenia hasła