This file contains 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 | |
from subprocess import getoutput | |
import os | |
import re | |
import fire | |
def main(*ag_args): | |
ag_args = ' '.join(ag_args) | |
print_matches(ag_args) |
This file contains 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 | |
from subprocess import getoutput | |
import os | |
import re | |
def main(): | |
files = get_files() | |
if not files[0]: return error() | |
nums = file_nums_to_open(files) |
This file contains 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 | |
from subprocess import getoutput | |
import re | |
def main(): | |
branches_dict = branches() | |
save_nums = input('type branch numbers to NOT delete, seperated by spaces\n') | |
save_nums = map(int, re.findall(r'\d+', save_nums)) | |
for num in save_nums: |
This file contains 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 clint.textui import colored | |
from time import sleep | |
sleep_time = .2 | |
array = [ | |
[2, 1, 0, 0, 0, 0], | |
[0, 0, 0, 1, 1, 0], | |
[0, 1, 1, 1, 0, 0], | |
[0, 1, 0, 0, 0, 1], |
This file contains 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 clint.textui import colored | |
from time import sleep | |
from random import randint | |
def s(divisor=1): | |
sleep(.5*divisor) | |
def get_diff_elems(list1, list2): |
This file contains 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 coding_challenge_specific_io(challenge_function): | |
with open('input') as in_data: | |
with open('output', 'w') as out_data: | |
in_lines = [x.strip() for x in in_data.readlines()[1:]] | |
in_data = parse_input_data(in_lines) | |
challenge_complete_lines = [challenge_function(data) for data in in_data] | |
out_lines = ['Case #{}: {}\n'.format(i+1, line) for i, line in enumerate(challenge_complete_lines)] | |
out_data.writelines(out_lines) |
This file contains 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 sqlite3 as sq | |
import numpy as np | |
from scipy.interpolate import spline | |
from matplotlib import pylab | |
def insert_data(c): | |
c.execute('create table if not exists sleep (hours_slept INT)') | |
print("How much sleep did ya get") | |
user_input = input() |
This file contains 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
//returns 3 if divisible by 3, 5 if divisible by 5, and 0 if neither and 10 if both | |
int fizz_buzz(int num) { | |
if((num % 3 == 0) && (num % 5 == 0)) | |
return 10; | |
else if(num % 3 != 0) { | |
if(num % 5 != 0) | |
return 0; | |
else | |
return 5; | |
} |
NewerOlder