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 | |
| from time import sleep | |
| print('Hi there.\n') | |
| sleep(2) | |
| print('End of program.') |
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/python2.7 | |
| # april 2016, regular expression search as found in | |
| # developers.google.com/edu/python/regular-expressions#basic-patterns | |
| import re | |
| str=raw_input('Enter a test sample >> ') | |
| match = re.search(r'\w\w\w example', 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
| # GistID:bc8a1e7243c0ad8b941955ec00dc618e | |
| # ~/.bashrc | |
| # | |
| # If not running interactively, don't do anything | |
| [[ $- != *i* ]] && return | |
| complete -cf sudo | |
| alias grep='grep --color=auto' | |
| alias ls='ls --color=auto' |
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
| -- Standard awesome library | |
| local gears = require("gears") | |
| vicious = require("vicious") | |
| local awful = require("awful") | |
| awful.rules = require("awful.rules") | |
| require("awful.autofocus") | |
| -- Widget and layout library | |
| local wibox = require("wibox") | |
| -- Theme handling library | |
| local beautiful = require("beautiful") |
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 | |
| #will create an empty vbox. | |
| function pause(){ | |
| read -p "$*" | |
| } | |
| echo 'Will create a vbox now c:' | |
| pause 'Press Enter to continue... ' |
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
| # Practice makes perfect, 8. | |
| # CodeCademy, April 8th 2016. | |
| # second time I do the Python course. | |
| def anti_vowel(text): | |
| new_text='' | |
| for char in text: | |
| # char.lower() not needed if string below contains all cases of vowel | |
| if char not in 'aeiouAEIOU': |
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
| # CodeCademy | |
| # 'Practices makes perfect', 9. | |
| score = {"a": 1, "c": 3, "b": 3, "e": 1, "d": 2, "g": 2, | |
| "f": 4, "i": 1, "h": 4, "k": 5, "j": 8, "m": 3, | |
| "l": 1, "o": 1, "n": 1, "q": 10, "p": 3, "s": 1, | |
| "r": 1, "u": 1, "t": 1, "w": 4, "v": 4, "y": 4, | |
| "x": 8, "z": 10} | |
| def scrabble_score(word): |
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 | |
| # A quick, basic and simple script to automate | |
| # the provisioning of a 10GB ArchLinux-x64 based Vbox; | |
| # CPU Cores and RAM manually assigned by user. | |
| # April, 2016. | |
| function pause(){ | |
| read -p "$*" | |
| } |
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 censor(text, word): | |
| output = text.replace(word, '*' * len(word)) | |
| return output | |
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 | |
| # Practice makes perfect, Count. | |
| def count(sequence,item): | |
| return len([i for i in sequence if i == item]) | |
| print(count(['ragnarok', 'ragnarok', 'murder', 'ragnarok'], 'ragnarok')) |
OlderNewer