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 find_alis_fourth_rectangle_vertex(coord1, coord2, coord3): | |
| x_coords = [coord1[0], coord2[0], coord3[0]] | |
| y_coords = [coord1[1], coord2[1], coord3[1]] | |
| fourth_x = None | |
| fourth_y = None | |
| for x in x_coords: | |
| if x_coords.count(x) == 1: | |
| fourth_x = x |
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 format_ampm_to_24H(time_str): | |
| time_parts = time_str.lower().strip().split() | |
| try: | |
| hours, minutes = map(int, time_parts[0].split(":")) | |
| except ValueError: | |
| return "Invalid input!" | |
| if len(time_parts) == 2: | |
| meridian = time_parts[1].lower() | |
| if meridian == "a.m.": |
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 calculate_dreamcatcher_number(period1, period2): | |
| a, b = period1 | |
| c, d = period2 | |
| max_product = max(a*c, a*d, b*c, b*d) | |
| return max_product | |
| if __name__ == "__main__": |
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 is_square(sides, angles): | |
| return all(side == sides[0] for side in sides) and all(angle == 90 for angle in angles) | |
| def is_rectangle(angles): | |
| return all(angle == 90 for angle in angles) | |
| def is_rhombus(sides): | |
| return all(side == sides[0] for side in sides) | |
| def is_parallelogram(angles): |
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
| import math | |
| def calculate_area(a, b, c): | |
| s = (a + b + c) / 2 | |
| area = math.sqrt(s * (s - a) * (s - b) * (s - c)) | |
| return area | |
| def classify_triangle(a, b, c): | |
| if a == b == c: | |
| return "equilateral" |
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 | |
| CURRENT_DIRECTORY=$(pwd) | |
| echo $'\e[1;31m'git reset --hard ? $'\e[0m' | |
| read -r -p "[y/N]" reset_changes_bool | |
| case "$reset_changes_bool" in | |
| y|Y) | |
| echo $'\e[1;32m'Pulling latest changes for all repositories ... $'\e[0m' | |
| for repo in $(find . -name ".git" | cut -c 3-); do | |
| cd "$repo"; | |
| echo "\033[34m"Pulling : @@ $repo @@"\033[0m"; |
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 random import randint | |
| def random_with_N_digits(n): | |
| range_start = 10**(n-1) | |
| range_end = (10**n)-1 | |
| return randint(range_start, range_end) | |
| for mciNumbers in range(0,100): | |
| print('0912', random_with_N_digits(7)) |
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
| require 'compass/import-once/activate' | |
| add_import_path "Require any additional compass plugins here" | |
| output_style = :compressed | |
| css_dir = "assets/css" | |
| sass_dir = "source/sass" | |
| # To enable relative paths to assets via compass helper functions : | |
| relative_assets = true |
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
| /*** | |
| run : node angryUpdate-dependencies.js && rm -rf node_modules && npm update --save-dev | |
| && npm update --save && rm -rf node_modules && npm update --save-dev && npm update --save | |
| in ypur project directory | |
| **/ | |
| var fs = require('fs'), | |
| angryUpdate = function() { | |
| var file = fs.readFileSync('package.json'), | |
| content = JSON.parse(file); |