This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def weekday_iterator(start=0): | |
""" This iterator generates the names | |
of week day starting from `start` day. """ | |
names = ('mo', 'tu', 'we', 'th', 'fr', 'sa', 'su',) | |
maximum = len(names) | |
i = 0 | |
while i < maximum: | |
index = (start + i) % maximum | |
value = names[index] | |
i += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def days_count_for_date_range(index, begin, end): | |
""" | |
Метод для вычисления количества появлений определённого дня недели | |
внутри указанного диапазона дат, включительно. | |
@type index: integer | |
@param index: Индекс дня недели, понедельник=0. | |
@type begin: datetime.date | |
@param begin: Дата начала диапазона. | |
@type end: datetime.date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import re | |
from django.shortcuts import redirect | |
PREF_VAR = 'ADMIN_PER_USER_PREF' | |
ORDER_VAR = 'o' | |
FILTER_TAIL = '__exact' | |
PATH = '/admin/storage/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; monokai-theme.el --- REQUIRES EMACS 24: Monokai Color Theme for Emacs. | |
;; Copyright (C) 2012 Lorenzo Villani. | |
;; | |
;; Author: Lorenzo Villani <[email protected]> | |
;; URL: https://github.com/lvillani/el-monokai-theme | |
;; Version: 0.0.10 | |
;; | |
;; This program is free software: you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published by |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; | |
;; Определение операционной системы | |
;; | |
(defun system-is-linux() | |
(string-equal system-type "gnu/linux")) | |
(defun system-is-windows() | |
(string-equal system-type "windows-nt")) | |
;; | |
;; Информация о пользователе |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from StringIO import StringIO | |
from cairo import ImageSurface, Context | |
from cairo import FORMAT_ARGB32, FONT_SLANT_NORMAL, FONT_WEIGHT_NORMAL | |
imagesize = (512,128) | |
surface = ImageSurface(FORMAT_ARGB32, *imagesize) | |
cr = Context(surface) | |
# paint background |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#usage "<b>Snap silkscreen text on grid</b><hr/>\n" | |
"<author>Author: Ruslan Popov ([email protected])</author>" | |
#require 6.05 | |
string VERSION = "1.0"; | |
int result = 0; // dialog result | |
string str; // temporary string | |
string cmd = "SET UNDO_LOG OFF;\n"; // script command to execute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Buffer visualisation thread. | |
*/ | |
static WORKING_AREA(visual_wa, 128); | |
static msg_t visual(void *arg) { | |
(void) arg; | |
uint8_t col = 0; | |
chRegSetThreadName("display_refresh"); | |
palWriteGroup(GPIOA, 0b11111111, 0, 0b00000000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hobbed Bolt Support | |
// Authors: Alexander, http://vk.com/linuxbashev | |
// Ruslan Popov, http://vk.com/id19523249 | |
// Original: http://www.thingiverse.com/thing:151669 | |
// Requires: http://curriculum.makerbot.com/daily_lessons/february/openscad_write.html | |
// Usage: | |
// * to generate all on one model: | |
// openscad -o all-in-one.stl hobbed_support.scad | |
// * to generate a particular model use 0, 1, or 2 as N: | |
// openscad -D only=N -o hobbed_N.stl hobbed_support.scad |
OlderNewer