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, Practice makes perfect. | |
| def product(n): | |
| total = 1 | |
| for x in n: | |
| total *= x | |
| return total |
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, Purify. | |
| def purify(series): | |
| new_series = [] | |
| for x in series: | |
| if x % 2 == 0: | |
| new_series.append(x) | |
| return new_series |
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, Practice makes perfect, 13: | |
| # Will multiply all items in a list. | |
| # Have to initialize total as 1 | |
| # total = 0 will not work for obvious reasons. | |
| def product(n): | |
| total = 1 | |
| for x in n: | |
| total *= x | |
| return total |
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, Practice Makes Perfect. | |
| def remove_duplicates(n): | |
| b = [] | |
| for x in n: | |
| if x not in b: | |
| b.append(x) | |
| return b |
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, median. | |
| # l1 = [8, 9, 10, 5, 6, 7, 1, 2, 3, 4] | |
| def median(l): | |
| l.sort() | |
| print l | |
| result = [] | |
| #odd numbers: | |
| #for i in l: | |
| if len(l) % 2 > 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
| "Keymap: i - Install plugin; c - Cleanup; s - Search; R - Reload list | |
| Plugin 'EditPlus' | |
| Plugin 'python_fold_compact' | |
| Plugin 'OnSyntaxChange' | |
| Plugin 'cst' | |
| Plugin 'php-cs-fixer' | |
| Plugin 'cscope.vim' | |
| Plugin 'EscapeBchars' | |
| Plugin 'HgCi' | |
| Plugin 'sourcebeautify.vim' |
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 example configuration file. Copy it to ## | |
| ## $HOME/.ncmpcpp/config or $XDG_CONFIG_HOME/ncmpcpp/config ## | |
| ## and set up your preferences. ## | |
| ############################################################## | |
| # | |
| ##### directories ###### | |
| ## | |
| ## Directory for storing ncmpcpp related files. | |
| ## Changing it is useful if you want to store |
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/python | |
| # will extract a .zip file in the desired location. | |
| # Nam Lah, May 2nd, 2016. | |
| # Based on Tom O'connor's response in | |
| # http://serverfault.com/questions/530114/are-there-other-options-to-unzip-a-file-in-ubuntu-besides-unzip | |
| import zipfile | |
| filename=input('Enter your .zip file name:\n>> ') |
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 | |
| # Nam Lah's text converter: | |
| # Will take a string and stdout all vowels as 'i'. | |
| # 2016, inspired on https://memegenerator.net/Japanese-Kid | |
| # fak u faggitz. | |
| def replacer(t): | |
| new_t = "" | |
| for char in t: | |
| if char.lower() in 'aeou': |
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") |