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
/* eslint-env node */ | |
const http = require('http'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const url = require('url'); | |
const { exec } = require('child_process'); | |
const { promisify } = require('util'); | |
const readFile = promisify(fs.readFile); |
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 { ApolloServer, gql } from 'apollo-server-micro'; | |
const typeDefs = gql` | |
type Query { | |
sayHello: String | |
} | |
`; | |
const resolvers = { | |
Query: { |
Loading
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
'use strict'; | |
const items = [ | |
{ id: 'a', group: 'x', count: 20 }, | |
{ id: 'b', group: 'x', count: 10 }, | |
{ id: 'c', group: 'x', count: 40 }, | |
{ id: 'c', group: 'y', count: 40 }, | |
{ id: 'c', group: 'y', count: 10 }, | |
{ id: 'c', group: 'y', count: 30 }, | |
{ id: 'c', group: 'z', count: 20 }, |
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
// @flow | |
import Koa from 'koa' | |
import Router from 'koa-router' | |
import { Observable, Subject } from 'rxjs/Rx' | |
type Epic = (observable: Observable) => Observable | |
const epic1 = observable => | |
observable.map(({ctx}) => { |
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
function promiseFirst(promises) { | |
function tryResolve([x, ...xs], resolve, reject) { | |
if (xs.length > 0) | |
x.then(resolve).catch(_ => tryResolve(xs, resolve, reject)) | |
else | |
x.then(resolve).catch(reject) | |
} | |
return new Promise((resolve, reject) => | |
tryResolve(promises, resolve, reject) | |
) |
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 fn_foo(data_one, data_two): | |
for element_x in select_element(data_one, lambda key, value, parent: key == | |
'type' and value == 'example' and 'flip' in parent and 'flop' in parent): | |
for element_y in select_element(data_two, lambda key, value, parent: key == | |
'flip' and value == element_y['flip']): | |
element_x['flop'] = element_y['flop'] |
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
docker-machine create \ | |
--driver virtualbox \ | |
--virtualbox-boot2docker-url https://github.com/boot2docker/boot2docker/releases/download/v1.9.1/boot2docker.iso \ | |
docker-191 | |
docker-machine start docker-191 | |
eval $(docker-machine env docker-191) | |
brew switch docker 1.9.1_1 |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<!-- ... --> | |
<dependencies> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> |
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
// ==UserScript== | |
// @name edx-enumerate | |
// @source https://gist.github.com/mfellner/194b7d70b9d1a682cf37 | |
// @downloadURL https://gist.github.com/194b7d70b9d1a682cf37.git | |
// @version 0.1.0 | |
// @description Enumerate answer choices | |
// @author mfellner | |
// @include *://courses.edx.org/courses/*courseware* | |
// @run-at document-idle | |
// @grant none |
NewerOlder