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 node:8.11.1 | |
RUN git clone https://github.com/Szpadel/chrome-headless-render-pdf.git /test | |
WORKDIR /test | |
RUN apt-get update && apt-get install -y fonts-liberation libappindicator1 libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libcups2 libdbus-1-3 libgtk-3-0 libnspr4 libnss3 libx11-xcb1 libxss1 lsb-release xdg-utils | |
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
RUN dpkg -i google-chrome-stable_current_amd64.deb |
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
diff --git a/index.js b/index.js | |
index 6b53ab4..b6dce0b 100644 | |
--- a/index.js | |
+++ b/index.js | |
@@ -87,15 +87,16 @@ class RenderPDF { | |
await LayerTree.enable(); | |
await Page.navigate({url}); | |
- await Emulation.setVirtualTimePolicy({policy: 'pauseIfNetworkFetchesPending', budget: 5000}); | |
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 ruby | |
require 'json' | |
seed_url = "https://sfbay.craigslist.org/jsonsearch/apa/sfc/?is_paid=all&search_distance_type=mi&max_price=4000&bedrooms=1&bathrooms=1%27" | |
listings = JSON.parse(`curl "#{seed_url}"`)[0] | |
results = [] | |
listings.each do |listing| | |
if listing['GeoCluster'] |
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 CoursePrerequisite < ActiveRecord::Base | |
belongs_to :course | |
belongs_to :prerequisite, :class_name => 'Course' | |
attr_accessible :required | |
belongs_to :suggested_by, :class_name => 'User' | |
end | |
class Course | |
has_many :course_prerequisites |