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 itertools import groupby | |
class PlayerNeeded(Exception): | |
pass | |
class Connect4: | |
""" |
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
#include <SerialRelay.h> | |
SerialRelay relays(13, 12, 1); // (pino de data, pino de clock, quantidade de módulos) | |
void setup() | |
{ | |
Serial.begin(115200); | |
} | |
String readSerialString() { |
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
clientSchema.pre('validate', function (next) { | |
// set code automatically | |
// generate all possible codes | |
// this is a fixed list from A/001 to Z/100 | |
let _all_codes = new Set() | |
for (let _letter of 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') { | |
for (let i = 1; i <= 100; i++) { | |
_all_codes.add(_letter + '/' + sprintf('%03d', i)); |
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
#!/bin/bash | |
# This hook is run after every virtualenv is activated. | |
# Se existir um arquivo manage.py no diretorio projeto, | |
# eh porque deve ser um projeto django. Entao, serah criado | |
# um alias chamado "manage" que executarah esse aquivo. | |
MANAGE_FILE=manage.py | |
if [ -f "$VIRTUAL_ENV/$VIRTUALENVWRAPPER_PROJECT_FILENAME" ] | |
then | |
project_dir=$(cat "$VIRTUAL_ENV/$VIRTUALENVWRAPPER_PROJECT_FILENAME") |