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
| <!doctype html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Contact manager</title> | |
| <style type="text/css"> | |
| body { | |
| display: flex; | |
| height: 100vh; |
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.5 | |
| import random | |
| def pickWord(): | |
| with open('hang_words.txt', 'r') as f: | |
| x = random.randint(0, 267750) | |
| # print x | |
| for i in range(267750): | |
| line = f.readline() | |
| if x==i: |
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.5 | |
| import random | |
| def main(): | |
| # the random number is in form of list | |
| num = [random.randint(0, 9) for i in range(4)] | |
| tries = 0 | |
| print(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
| #!/usr/bin/python3.5 | |
| from collections import Counter | |
| import json | |
| def help(): | |
| print('Available options:') | |
| print('\t\'add <name>\' to add a new entry') | |
| print('\t\'show <name|all>\' to show the birthday.') |
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.5 | |
| def grid(x=1, y=1): | |
| hor_line = ' ---' | |
| ver_line = '| ' | |
| print(hor_line*x) | |
| for i in range(y): | |
| print(ver_line*x+'|') | |
| print(hor_line*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
| from bs4 import BeautifulSoup | |
| import requests | |
| soup = BeautifulSoup(requests.get('http://nytimes.com').content, 'html.parser') | |
| for i in soup(class_='story-heading'): | |
| print(i.text.strip()) |
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 | |
| # You'll need to set a keybind to run this script | |
| # It will change the keyboard layout and create a file in `/tmp` | |
| # indicating the current layout lang. | |
| # Use the module `path_exists` of i3status to check | |
| # if the file (named here `currlang_ar`) is created | |
| layout=$(setxkbmap -query | grep layout | cut -d: -f2 | sed -e 's/^[[:space:]]*//') | |
| if [ $layout == 'us' ] ; then |
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
| name = "Begovich" | |
| template = "Hello, {name}" | |
| print(template.format(**globals())) |
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
| """ | |
| This is the code running the Telegram bot @veryactivebot | |
| (https://t.me/veryactivebot). It ensure that the bot is | |
| always doing an action: typing, uploading a document, | |
| sending audio.. If anyone, for whatever mysterious reason, | |
| finds this code useful, they can use as they want, as long | |
| as they refer to its source. | |
| In order for the bot to work, its authentification token is | |
| needed. This token can be specified in an environment |
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
| <style> | |
| #container { | |
| display: block; | |
| max-width: 300px; | |
| height: 100px; | |
| overflow: hidden; | |
| white-space: nowrap; | |
| padding: 0; | |
| margin: 0; | |
| } |