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
# VM Config | |
$ssh_user = "vagrant" | |
$vcpus = "4" | |
$vmem = "4096" | |
$centos8_box = "generic/centos8" | |
$centos8_box_ver = "3.0.10" | |
# Synced Folders |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# NOTE: Variable overrides are in ./config.rb | |
require "yaml" | |
require "fileutils" | |
# Use a variable file for overrides: | |
CONFIG = File.expand_path("config.rb") | |
if File.exist?(CONFIG) | |
require CONFIG |
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
""" | |
Find repeating words within text file | |
return: | |
word and count | |
Sentence is here. Sentence two is here. | |
""" |
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 find_grants_cap(grantsArray, newBudget): | |
cap = float(0) | |
grantsArray.sort(reverse = True) | |
# pad the array with a zero at the end to cover the case where 0 <= cap <= grantsArray[i] | |
grantsArray.append(0) | |
# calculate the total amount we need to cut back to meet the reduced budget | |
surplus = sum(grantsArray) - newBudget | |
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 bracket_match(text): | |
stack = [] | |
for char in text: | |
if char == ")": | |
if stack: | |
if stack[-1] == "(": | |
stack.pop() | |
else: |
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
#!/bin/bash -eux | |
pushd /tmp | |
sudo dnf -y install python3 git ansible | |
#sudo python3 -m pip install pyyaml ansible | |
pushd /tmp/ansible |
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 sys | |
import os | |
import pandas as pd | |
NARRATIVE = "Consumer complaint narrative" | |
inFile = str(sys.argv[1]) | |
label = str(sys.argv[2]) | |
outFile = label.replace(" ", "_") |
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 | |
import ovh | |
import json | |
import argparse | |
def reimage(ovhClient, ovhServerName, sshKeyName, hostName, ovhTemplateName, useDistribKernel=False): | |
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
class Solution: | |
# Dynamic Programming: Time: O(n) Space O(n) | |
def maxSubArrayDP(self, nums: List[int]) -> int: | |
if not nums: | |
return 0 | |
maxSum = nums[0] | |
DP = [0]*len(nums) # DP will hold the max sum so far |
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
# Definition for singly-linked list. | |
# class ListNode: | |
# def __init__(self, x): | |
# self.val = x | |
# self.next = None | |
class Solution: | |
def isPalindrome(self, head: ListNode) -> bool: | |
# low hanging fruit |