Skip to content

Instantly share code, notes, and snippets.

View ryanhugh's full-sized avatar
🌴
On vacation

Ryan Hughes ryanhugh

🌴
On vacation
View GitHub Profile
// Same API as the built in fs module, but supports es6 "await"
import fs from 'fs-promise';
// I like superagent because it works in both the frontend and the backend
// supports, es6 "await", and has a pretty good API :)
import superagent from 'superagent';
// Download this file and the package.json into the same directory,
// and then run npm install (or yarn) to install the modules
var request = require('request')
var dns = require('dns');
dns.lookup('www.google.com', (err, address, family) => {
console.log('IP for www.google.com is:', address);
let cookieJarWithIp = request.jar()
let cookieJarWithDomain = request.jar()
var words = ['Hamburger', 'Wine', 'Cheese'];
var link = 'https://en.wikipedia.org/wiki/';
words.forEach(function(word) {
var link = 'https://en.wikipedia.org/wiki/' + word;
request(link, function(response, html) {
var $ = cheerio.load(html);
var data = $(this);
console.log(link);
for (var i = 0; i < words.length; i++) {
var link = 'https://en.wikipedia.org/wiki/' + words[i];
request(link, function(response, html) {
console.log(html.body.length) // Note that this has differnt lengths which means the pages are different
var $ = cheerio.load(html);
var data = $(this);
console.log(link, i);
})
}
@ryanhugh
ryanhugh / terms.html
Created December 18, 2017 22:20
Terms
<OPTION VALUE="201834">Spring 2018 CPS Semester</OPTION>
<OPTION VALUE="201832">Spring 2018 Law Semester</OPTION>
<OPTION VALUE="201830">Spring 2018 Semester</OPTION>
<OPTION VALUE="201828">Winter 2018 Law Quarter</OPTION>
<OPTION VALUE="201825">Winter 2018 CPS Quarter</OPTION>
<OPTION VALUE="201818">Fall 2017 Law Quarter</OPTION>
<OPTION VALUE="201815">Fall 2017 CPS Quarter</OPTION>
<OPTION VALUE="201814">Fall 2017 CPS Semester</OPTION>
<OPTION VALUE="201812">Fall 2017 Law Semester</OPTION>
<OPTION VALUE="201810">Fall 2017 Semester</OPTION>
<OPTION VALUE="201802">Spring 2018</OPTION>
<OPTION VALUE="201728">Language Inst IEP: Fall 2 2017 (View only)</OPTION>
<OPTION VALUE="201708">Fall 2017</OPTION>
<OPTION VALUE="201705">Summer 2017</OPTION>
<OPTION VALUE="201702">Spring 2017</OPTION>
<OPTION VALUE="201608">Fall 2016 (View only)</OPTION>
<OPTION VALUE="201605">Summer 2016 (View only)</OPTION>
<OPTION VALUE="201602">Spring 2016 (View only)</OPTION>
<OPTION VALUE="201508">Fall 2015 (View only)</OPTION>
<OPTION VALUE="201505">Summer 2015 (View only)</OPTION>
.frontend-components-panels-___DesktopClassPanel__resultsTable___x6hQD {
border: none!important;
margin-bottom: 0!important
}
.frontend-components-panels-___DesktopClassPanel__resultsTable___x6hQD th {
border-left: none!important;
background: none!important
}
.frontend-components-panels-___DesktopClassPanel__inlineBlock___18DCK {
display: inline-block
@ryanhugh
ryanhugh / Summer1.md
Created February 16, 2018 08:25
List of online classes in Summer I 2018
@ryanhugh
ryanhugh / Summer2.md
Created February 16, 2018 08:27
List of online classes in Summer II 2018