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 random | |
foo = [1, 2, 3, 4, 5, 6] | |
random_selection = lambda: random.choice(foo) | |
random_selection() |
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
# Even spaces are compared! | |
my_string1 = "h4110 w0r1d" | |
my_string2 = "hello world" | |
def similar(my_string1, my_string2): | |
a = b = c = d = [] | |
a.append(my_string1) | |
b.append(my_string2) | |
counter = 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
import random | |
import string | |
characters = string.digits + string.ascii_letters | |
random_selection = lambda: [random.choice(characters) for x in range(16)] | |
random_join = ''.join(random_selection()) | |
final_list = [] | |
counter = 1 | |
for each in random_join: |
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 should probably be using colorama.. | |
class my_color(object): | |
def __init__(self, first_color, second_color): | |
self.first_color = first_color | |
self.second_color = second_color | |
self.primary_colors = ['blue', 'red', 'yellow'] | |
self.secondary_colors = ['green', 'purple', 'orange'] | |
self.tertiary_colors = ['amber', 'vermillion', 'magenta', | |
'violet', 'teal', 'chartreuse'] |
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/env python | |
# -*- coding: utf-8 -*- | |
import csv | |
import Tkinter | |
import tkFileDialog | |
import sys | |
def calc_hours_shift(a_shift): |
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 java.io.*; | |
import java.util.*; | |
import com.opencsv.CSVReader ; | |
import com.opencsv.CSVWriter ; | |
import java.net.*; | |
import javax.swing.filechooser.FileFilter; | |
import javax.swing.filechooser.FileNameExtensionFilter; | |
import javax.swing.JFileChooser; | |
import javax.swing.JOptionPane; |
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 string | |
a = input('Input text to Spongebobify: ') | |
b = [] | |
upper_case = False | |
for each in range(0, len(a)): | |
if a[each] in string.ascii_letters: | |
if not upper_case: | |
b.append(a[each].lower()) | |
upper_case = 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
#!/usr/bin/env python3 | |
import requests | |
import sys | |
import time | |
try: | |
print('CTRL + D or CTRL + C will close the program at any time.') | |
stock_names_input = input('Stock names separated by \',\' (AAPL, GOOG, TSLA): ') | |
stock_prices_input = input('Stock prices you bought in at separated by \',\' (100.00, 23.31, 493.84): ') |
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 requests | |
get_this = requests.get('https://api.coinmarketcap.com/v1/ticker/?convert=USD&limit=2000') | |
all_dict = {} | |
for each in get_this.json(): | |
ticker = each['symbol'] | |
all_dict[ticker] = {} | |
all_dict[ticker]['rank'] = each['rank'] | |
all_dict[ticker]['price'] = each['price_usd'] |
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 requests | |
nu_get = [] | |
print('- Downloading https://adaway.org/hosts.txt') | |
one_get = requests.get('https://adaway.org/hosts.txt') | |
print('- Done\n') | |
print('- Downloading https://hosts-file.net/ad_servers.txt') | |
two_get = requests.get('https://hosts-file.net/ad_servers.txt') |