rails-html-sanitizer:
racc-1.6.0
signet:
faraday-net_http-3.0.0
ruby2_keywords-0.0.5
rails-dom-testing:
racc-1.6.0
rest-client:
http-accept-1.7.0
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
# unsuccessful attempt to convert the basic pitch csv into sheet music. Difficult because converting seconds to beats is difficult | |
from midiutil.MidiFile import MIDIFile | |
from csv import reader | |
import sys | |
hard_coded_start_time = 1.184217687 | |
def csv_to_midi(csv_path, output_path): |
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/sh | |
set -e # exit immediately if any command fails | |
# Warning: | |
# Resets the db | |
# Assumptions: | |
# This script is run from rubygems.org root directory | |
# elasticsearch, memcached, and postgresql are running. For me, this meant | |
# docker run -p 9200:9200 -e "http.host=0.0.0.0" -e "transport.host=127.0.0.1" docker.elastic.co/elasticsearch/elasticsearch:7.10.1 | |
# memcached |
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 get_dependencies(gem_name) | |
# query rubygems.org api for dependencies of gem_name | |
# return array of dependencies | |
# requires uri, net/http, and json | |
uri = URI("https://rubygems.org/api/v1/gems/#{gem_name}.json") | |
response = Net::HTTP.get_response(uri) | |
res = JSON.parse(response.body) if response.is_a?(Net::HTTPSuccess) | |
res["dependencies"]["runtime"].map { |dep| dep["name"] } | |
end |
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 get_downloads(gem_name, version=nil) | |
# query rubygems api for total downloads of gem_name for the given version | |
# return integer of downloads | |
# if version is nil, return total downloads of the latest version | |
# requires uri, net/http, and json | |
if version == nil | |
uri = URI("https://rubygems.org/api/v1/gems/#{gem_name}.json") | |
response = Net::HTTP.get_response(uri) | |
res = JSON.parse(response.body) if response.is_a?(Net::HTTPSuccess) | |
res["downloads"] |
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 bundle_lock_deps(gem_name) | |
# reads Gemfile.lock resolved dependencies and return them in an Array of [name, version] pairs | |
# requires bundler | |
delete_gemfiles | |
write_gem_to_gemfile(gem_name) | |
raise "bundle lock errored" unless system("bundle lock > /dev/null") | |
# read Gemfile.lock and return an Array of gem names | |
parser = Bundler::LockfileParser.new(Bundler.read_file('Gemfile.lock')) | |
output = [] |
googleauth:
faraday-net_http:
googleauth→faraday→faraday-net_http
googleauth→signet→faraday→faraday-net_http
memoist:
googleauth→memoist
os:
googleauth→os
ruby2_keywords:
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 dfs(start, target) | |
paths = [] | |
dfs_helper(start, target, [], paths) | |
paths | |
end | |
# note, no cyclic graphs allowed in dependencies, so no visited set needed | |
def dfs_helper(start, target, path, paths) | |
path << start | |
@graph[start].each do |node| |
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
""" | |
Code used to make Swain video wit healing annotation. Nothing special, just manual frame annotation (30 mins). | |
CV would have been over-engineering IMO. | |
pip install streamlit | |
pip install numpy | |
pip install opencv-python==4.5.5.62 | |
Read the bottom of the code for run instructions. | |
""" |
OlderNewer