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
| """ | |
| FB Challenge: https://www.facebook.com/groups/251560641854558/permalink/622857261391559/ | |
| """ | |
| def printStuff(num): | |
| start = ''.join(list(map(str, range(1, num + 1)))) | |
| for x in range(num, 0, -1): | |
| print(f'{x}{start[1:num]}') | |
| num -= 1 | |
| print() |
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
| def gen_table(nums, stop=12): | |
| for num in nums: | |
| print(gen_title(num)) | |
| for x in range(1, stop+1): | |
| result = pad(num * x, 3) | |
| print(f' {pad(num)} x {pad(x)} = {result}') | |
| print('') | |
| def gen_title(num): |
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
| #!/bin/bash | |
| clear | |
| echo "##################" | |
| echo "# CURRENT KERNEL #" | |
| echo "##################" | |
| echo "" | |
| uname -r | |
| echo "" | |
| echo "######################" | |
| echo "# INSTRALLED KERNELS #" |
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
| #!/home/mohh/anaconda3/bin/python | |
| from collections import namedtuple | |
| from os import system | |
| Video = namedtuple('Video', 'name link') | |
| videos = [ | |
| Video('0.1 - Introduction', 'https://edx-video.net/HARUPRXX2016-V000100_DTH.mp4'), | |
| Video('1.1.1 - Python Basics', 'https://edx-video.net/HARUPRXX2016-V000200_DTH.mp4'), | |
| Video('1.1.2 - Objects', 'https://edx-video.net/HARUPRXX2016-V000400_DTH.mp4'), |
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
| from os import system, name | |
| from time import sleep | |
| from console import clear | |
| # art from https://codereview.stackexchange.com/questions/101968/hangman-with-ascii | |
| ascii_art = (""" | |
| _________ | |
| |/ | |
| | |
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
| def check_value(value): | |
| """ | |
| Validates the value that was passed into the program. | |
| :param value: A positive integer is the only valid value | |
| :return: int or an exception is raised | |
| """ | |
| if isinstance(value, bool): | |
| raise ValueError | |
| elif isinstance(value, str): |
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
| #!/bin/bash | |
| ps awxx | grep $1 | grep -v get_pid | grep -v grep | awk '{print $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
| # secret message code challenge | |
| # https://dev.to/rpalo/secret-message-7do | |
| from string import ascii_lowercase | |
| from long_string import code | |
| ALPHA = ascii_lowercase + '_' | |
| def count(letters): | |
| counts = {} | |
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
| #!/bin/bash | |
| echo $(ifconfig | grep 'inet addr:' | grep -v '127.0.0.1' | cut -d: -f2 | awk '{print $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
| #!/bin/bash | |
| sudo dmidecode | awk '/^Memory\ Device$/,/Size/{if ($0~/Size/)print}' |