Skip to content

Instantly share code, notes, and snippets.

@sungamagnus
sungamagnus / check_sudoku.py
Created July 17, 2012 00:09
my check_sudoku for udacity cs258 Unit 3 - HW 1
#!/usr/bin/env python
# SPECIFICATION:
#
# check_sudoku() determines whether its argument is a valid Sudoku
# grid. It can handle grids that are completely filled in, and also
# grids that hold some empty cells where the player has not yet
# written numbers.
#
# First, your code must do some sanity checking to make sure that its
@sungamagnus
sungamagnus / webtail.py
Last active October 31, 2016 19:21 — forked from scoffey/webtail.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
HTTP server that provides a web interface to run "tail" on a file,
like the Unix command.
This is a standalone script. No external dependencies required.
How to invoke:
#!/bin/bash
# If the process is already running, you can use the following:
PID=`pgrep processname`
renice -n 19 $PID
ionice -c 3 -p $PID
# For new processes, just chain them together
nice -n 19 ionice -c 3 processname
@sungamagnus
sungamagnus / designer.html
Last active August 18, 2016 22:20
designer
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<polymer-element name="my-element">
@sungamagnus
sungamagnus / docker-compose.yml
Created November 17, 2016 02:14
Minimal docker-compose.yml for redmine+postgres ref: https://hub.docker.com/_/redmine/
version: '2'
services:
redmine:
image: redmine
ports:
- 8080:3000
environment:
REDMINE_DB_POSTGRES: db
@sungamagnus
sungamagnus / main.dart
Last active March 30, 2020 05:02
list addAll(null) throw
void main() {
final aList = <String>[];
aList.addAll(['a','b']);
print('#1: $aList');
aList.addAll(null);
print('#2: $aList');
}