- Defines the handler (takes App and conf as args)
- Sets up a new laucher with conf and events
- Runs
#run
, starts the server
- Runs
#run
on the "runner" - Loads the App
@launcher.config.app
lass AbgtScraper(Scraper): | |
def __init__(self): | |
self.index_url = app.config['ABGT_INDEX_URL'] | |
def get_episode_urls(self): | |
""" Get every episode url so we can scrape them """ | |
try: | |
page = urlopen(self.index_url) | |
except: | |
return [] |
def longest(s, m): | |
longest_length = 0 | |
current_length = 0 | |
used_letters = set() | |
for i, letter in enumerate(s): | |
if letter not in used_letters: | |
used_letters.add(letter) | |
if len(used_letters) > m: | |
if current_length > longest_length: | |
longest_length = current_length |
Lateral Cut Groove - Spring Tide (Subandrio Remix) |
#!/usr/bin/env babel-node --optional es7.asyncFunctions | |
import fs from 'fs'; | |
import path from 'path'; | |
import { introspectionQuery, printSchema } from 'graphql/utilities'; | |
var fetch = require('node-fetch'); | |
// Save JSON of full schema introspection for Babel Relay Plugin to use | |
fetch('http://localhost:3000/queries', { |
module Mutations | |
class MarkPullRequestAsReviewed < Graph::Relay::Mutation | |
class Resolver | |
class << self | |
def call(obj, args, ctx) | |
pr = PullRequest.find(args["pullRequestId"]) | |
pr.update!(reviewed: true) | |
{ pullRequest: pr } | |
end | |
end |
// PROTOTYPAL INHERITANCE | |
// In prototypal languages you only have objects. No classes! | |
// ex nihilo | |
const object = Object.create(null); | |
console.log(object); |
// Sample ActionCable ES6 client | |
// | |
// To be used like: | |
// | |
// const myEventHandlerFunction = (event) => { | |
// console.log(event.message); | |
// } | |
// | |
// ActionCableClient.connect( | |
// 'ws://localhost:3000/cable', |
query { | |
firstFilm: film(id: "1") { | |
title | |
} | |
secondFilm: film(id: "2") { | |
title | |
} | |
} |