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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
var fs = require("fs") | |
var request = require("request") | |
module.exports = function(url, dest, cb) { | |
var file = fs.createWriteStream(dest) | |
var sendReq = request.get(url) | |
// verify response code | |
sendReq.on("response", function(response) { | |
if (response.statusCode !== 200) { |
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
[...document.querySelectorAll('.invite-card')].forEach(card => { | |
const headline = card.querySelector('.headline').textContent; | |
const accept = card.querySelector('.bt-invite-accept'); | |
const decline = card.querySelector('.bt-invite-decline'); | |
const name = card.querySelector('.name').textContent; | |
if(headline.match(/recruit/gi)) { | |
console.log(`Nah. ${name} looks a little fishy to me. 🚷🚷🚷`); | |
decline.click(); | |
} 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
import gym | |
from gym import wrappers | |
logPath = '/tmp/cartpole-experiment-1' | |
apiKey = 'sk_Cw5T7JD1RY2u6Gn4DVTjw' | |
env = gym.make('CartPole-v0') | |
env = wrappers.Monitor(env, logPath) | |
for i_episode in range(20): | |
observation = env.reset() | |
for t in range(100): |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 React from 'react' | |
const Blog = (props) => { | |
const posts = props.data.allMarkdownRemark.edges | |
return ( | |
<div> | |
<h1> blog pages </h1> | |
<ul> | |
{posts.map(post => { |
OlderNewer