Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# clone ci repo
# install essential deps
cd ~
rm
apt-get update
apt-get install -y git curl make ruby1.9.1-dev
curl -L https://www.opscode.com/chef/install.sh | bash
gem install --no-ri --no-rdoc librarian-chef
@ViktorOgnev
ViktorOgnev / gist:3160335
Created July 22, 2012 17:12
Check sudoku - solve sudoku
def check_sudoku(grid, p_info = False, gridsize = 9):
'''sudoku checker - enter True as second func. argument
to print more info
about check failures'''
def check_sudoku_complete_results(grid, gridsize = 9):
if type(grid) != list: return None, 'function accepts list, got %s instead' % (str(type(grid)))
if gridsize % 3 != 0: return None, 'incorrect size'
if len(grid) != gridsize:
@ViktorOgnev
ViktorOgnev / gist:3160310
Created July 22, 2012 17:11
Check sudoku - solve sudoku
def check_sudoku(grid, p_info = False, gridsize = 9):
'''sudoku checker - enter True as second func. argument
to print more info
about check failures'''
def check_sudoku_complete_results(grid, gridsize = 9):
if type(grid) != list: return None, 'function accepts list, got %s instead' % (str(type(grid)))
if gridsize % 3 != 0: return None, 'incorrect size'