Skip to content

Instantly share code, notes, and snippets.

View a-sk's full-sized avatar

Skurikhin Alexander a-sk

  • Russia, Saint-Petersburg
View GitHub Profile
1,2c1
< import typing
< from collections import Iterable, OrderedDict, namedtuple
---
> from collections import OrderedDict, namedtuple
27c26
< changed: List[Optional[Node]] = []
---
> changed: List[str] = []
31,34c30,31
from collections import OrderedDict, namedtuple
from copy import deepcopy
from typing import Callable, List, Optional
Node = namedtuple('Node', 'name, branches')
Image = namedtuple('Image', 'name, build_from')
images = [
Image('image1', 'centos:7'), # root
from collections import OrderedDict, namedtuple
from copy import deepcopy
from typing import Callable, List, Optional
Node = namedtuple('Node', 'name, branches')
Image = namedtuple('Image', 'name, build_from')
images = [
Image('image1', 'centos:7'), # root
(define (h->rgb h)
(define hi (round (/ h 60)))
(define vmin 0)
(define a ( round (* 100 (/ (modulo h 60) 60))))
(define vinc a)
(define vdec (- 100 a))
<?xml version="1.0" ?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest" name="export">
<service name="network/openvpn" type="service" version="0">
<create_default_instance enabled="true"/>
<single_instance/>
<dependency name="fs" grouping="require_all" restart_on="none" type="service">
<service_fmri value="svc:/system/filesystem/local"/>
</dependency>
<dependency name="net" grouping="require_all" restart_on="none" type="service">
# Licensed under CC BY 3.0 http://creativecommons.org/licenses/by/3.0/
# Derived works must attribute https://gist.github.com/4492300 at the beginning, and the date.
##########################################################
Installing and Configuring SmartOS on Hetzner (with a /29)
##########################################################
# if you find this gist useful, please star it
# thanks to: jamesog, linuxprofessor, ryancnelson for help with routing
<html>
<head>
<title>beep</title>
</head>
<body>
<div class="a">¡¡¡</div>
<div class="b">
<span>tacos</span>
<span>y</span>
<span>burritos</span>
@a-sk
a-sk / README.markdown
Created August 17, 2011 16:30 — forked from ariera/README.markdown
Nestable, sortable and dragable categories

Nestable, sortable and dragable categories:

In the project I'm working on we wanted to have a Category model which we wanted to be nestable. But we also liked the user to have a draggable interface to manage and rearrange the order of his categories. So we chose awesome_nested_set for the model and jQuery.nestedSortable for the UI.

It took me some time to arrange things to work properly so I wanted to share my work in case it helps anybody.

Before beginning

you might want to take a look at a demo app

  1. go to: http://awesomenestedsortable.heroku.com/groups/
  2. click in show of any group
@a-sk
a-sk / gist:1150663
Created August 17, 2011 02:15
Ruby Style Guide
Original Source: https://github.com/chneukirchen/styleguide
= Christian Neukirchen's Ruby Style Guide
You may not like all rules presented here, but they work very well for
me and have helped producing high quality code. Everyone is free to
code however they want, write and follow their own style guides, but
when you contribute to my code, please follow these rules:
#!/bin/ash
GetBooksFromSubDir() # Сканирование папки второго уровня и ее подпапок
{
SERIAL_PATH=$1
for k in "$SERIAL_PATH"/*
do
if [ -f "$k" ]
then
AddBook "BOOKS" "$k"