Skip to content

Instantly share code, notes, and snippets.

View Lvl4Sword's full-sized avatar
💚
Whatever you do, do it well.

Scott King Lvl4Sword

💚
Whatever you do, do it well.
View GitHub Profile
#!/usr/bin/env python3
import json
import requests
import sys
band = None
user = None
counter = 0
input_stripped = input('Input a band (or hit enter for user): ').strip()
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')
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']
#!/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): ')
@Lvl4Sword
Lvl4Sword / spongebobify.py
Created July 20, 2017 19:28
Because why not
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
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;
@Lvl4Sword
Lvl4Sword / csv.py
Last active December 23, 2016 07:19
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import csv
import Tkinter
import tkFileDialog
import sys
def calc_hours_shift(a_shift):
# 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']
@Lvl4Sword
Lvl4Sword / random_dashes.py
Last active October 5, 2016 05:23
Generate 16 random characters, with each 4 separated by a dash
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:
@Lvl4Sword
Lvl4Sword / similar.py
Last active May 15, 2016 04:24
Comparing two strings
# 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