Skip to content

Instantly share code, notes, and snippets.

View cra's full-sized avatar
🔥

Igor cra

🔥
View GitHub Profile
@cra
cra / dossier.html
Created April 1, 2014 21:13
fixing application form layout
{% extends 'base.html' %}
{% load i18n %}
{% load crispy_forms_tags %}
{% load placeholder %}
{% block extra_head %}
<!--[if gte IE 9]>
<style>
.ie_show { display:block }
.ie_hide { display:none }
</style>
{% extends 'workshopz/in/base.html' %}
{% load markup thumbnail crispy_forms_tags %}
{% block extrahead %}
<script>
var blank="http://upload.wikimedia.org/wikipedia/commons/c/c0/Blank.gif";
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
{% block extra_scripts %}
<script src="{{STATIC_URL}}bootstrap/js/bootstrap.js" type="text/javascript"></script>
<script src="{{ STATIC_URL }}js/autoresize.jquery.min.js"></script>
<script type="text/javascript">
function update_parent_fields() {
var p_fullname, p_phone;
var radio0 = $("#id_dossier-and-contacts-parental_confirm_0");
var radio1 = $("#id_dossier-and-contacts-parental_confirm_1");
if (ask_parents == true) {
@cra
cra / seva.py
Last active August 29, 2015 14:03
#!/usr/bin/python2
# coding: utf-8
import webbrowser
import urllib2
import time
FILENAME = "satana.dat"
#!/bin/env python
# coding: utf-8
"""
Basic flask REST API-app to, thanks to
http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask
$ git clone (url) testflask
$ cd testflask
$ virtualenv .
@cra
cra / models.py
Created July 29, 2014 14:51
Multiple foreignkeys for dummies
from app import db
class Copter(db.Model):
__tablename__ = "Copter"
id = db.Column(db.Integer, primary_key=True)
comment = db.Column(db.Unicode(100))
current_stay = db.Column(db.PickleType)
@cra
cra / dudes.jpg
Last active August 29, 2015 14:04
Multiple foreignkeys for dummies
dudes.jpg
#!/bin/env python2
# coding: utf-8
import types
class Structure(object):
''' Some sort of a data container '''
def __init__(self, value=42):
@cra
cra / yoba.sh
Last active August 29, 2015 14:10
Bash stub. Autocopy file to the USB inserted
#!/bin/bash
INITIAL_MOUNTPOINT=/media/0000-0001
PATH_TO_FILE=/tmp/TAMD_2014_Abstract_book.pdf
INTERVAL=5
DEVICE=/dev/sdc1
NEW_LABEL=TAMD-2014
while true; do
@cra
cra / copy from yaourt output
Last active August 29, 2015 14:14
aur/modules compiling problem
==> Making package: modules 3.2.10-1 (Tue Feb 3 15:50:25 CET 2015)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Downloading modules-3.2.10.tar.bz2...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 383 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 461 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 375 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0