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
#!/usr/bin/env python3 | |
# vim: set ts=4 sts=0 et sw=4 smarttab : | |
"""2048 game in Python (cli, PyQt 4 or 5).""" | |
import time | |
import math | |
import sys | |
from random import choice | |
ROW = 4 |
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
max = 100 | |
f = (("FizzBuzz", range(15, max+1, 15)), ("Buzz", range(5, max+1, 5)), ("Fizz", range(3, max+1, 3))) | |
for i in range(1, max+1): | |
for n, r in f: | |
if i in r: | |
i = n | |
break | |
print(i) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 buildpack-deps:jessie | |
EXPOSE 8080 5000 | |
ENV LANG C.UTF-8 | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt-get update && \ | |
apt-get upgrade -q -y && \ | |
apt-get install -q -y \ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
"""FizzBuzz. | |
Write a program that prints the numbers from 1 to 100. | |
But for multiples of three print “Fizz” instead of the number and | |
for the multiples of five print “Buzz”. | |
For numbers which are multiples of both three and five print “FizzBuzz”. | |
-- http://c2.com/cgi/wiki?FizzBuzzTest | |
""" | |
def fizzy(number, text, destination): |
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
""" | |
Game of Life according to Jack Diedrich. | |
From the PyCon presentation: Stop Writing Classes. | |
""" | |
import os | |
import time | |
from itertools import chain |
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 | |
[ "root" != "$USER" ] && exec sudo $0 "$@" | |
read -p "Nom d'utilisateur CPLN: " username | |
uid=$(id -u $SUDO_USER) | |
gid=$(id -g $SUDO_USER) | |
sudo mount -t cifs \ | |
//s2.rpn.ch/home/CPLN/Eleves/ET/$username /home/$SUDO_USER/Bureau/CPLN \ | |
-o username=$username,domain=s2,uid=$uid,gid=$gid |
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
# -*- encoding: utf-8 -*- | |
import json | |
import asyncio | |
import requests | |
import websockets | |
TOKEN="xoxb-..." |