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
#search-result .ng-enter { | |
transition: 0.2s linear all; | |
opacity: 0; | |
line-height: 0em; | |
} | |
#search-result .ng-enter-active { | |
opacity: 1; | |
line-height: inherit; | |
} |
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
require("angular"); | |
module.exports = angular; |
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"; | |
var _ = require("lodash"); | |
var angular = require("angularjs"); | |
module.exports = function diverge(rootModuleName, ngComponents) { | |
angular.module(rootModuleName, []) | |
.config(decorateInjector) | |
.config(decorateControllerProvider); |
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
const fs = require("fs") | |
// The 3 following modules need to be installed | |
const csvStream = require("csv-stream") | |
const csvWriteStream = require("csv-write-stream") | |
const through2Map = require("through2-map") | |
fs.createReadStream("in.csv") | |
.pipe(csvStream.createStream({ | |
// will use the first line as a header containing the keys for the resulting objects | |
delimiter: ";" // other options: https://www.npmjs.com/package/csv-stream |
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
const assert = require("assert") | |
const fs = require("fs") | |
const parser = require("graphql/language/parser") | |
const _ = require("lodash") | |
const write = (path, json) => fs.writeFileSync(path, JSON.stringify(json, null, 2)) | |
const inputGraphQl = ` | |
query { | |
families(name: "Stark") { |
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
const fs = require('fs'); | |
function walk(root) { | |
const files = []; | |
const dirs = [root]; | |
while (dirs.length) { | |
const dir = dirs.shift(); | |
const dircontent = fs.readdirSync(dir).map(file => path.join(dir, file)); | |
const [newDirs, newFiles] = partition(dircontent, file => fs.statSync(file).isDirectory()); | |
files.push(...newFiles); |
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
const yazl = require('yazl'); | |
function zip(...files) { | |
const archive = new yazl.ZipFile(); | |
files.forEach(file => archive.addFile(file, file)); | |
archive.end(); | |
return archive.outputStream; | |
} |
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
const browserSync = require('browser-sync'); | |
module.exports = (port, path, callback) => { | |
const browserSyncServer = browserSync.create(); | |
browserSyncServer.init({ | |
port, | |
serveStatic: [path], | |
// Other Browser Sync options go here | |
}, callback); | |
return {close: () => browserSyncServer.exit()} |
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
module Main exposing (..) | |
import Html exposing (Html, text) | |
import Html.Events exposing (onClick) | |
import Json.Decode exposing (..) | |
import Http | |
main = | |
Html.program { init = init, subscriptions = subscriptions, view = view, update = update } |
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
# This is a revised, cleaned up version of the code for exercise 3 | |
ncables, nreservations = map(int, input().split()) | |
reservations = [tuple(map(int, input().split())) for _ in range(nreservations)] | |
reservations = [(i, start, end) for (i, (start, end)) in enumerate(reservations)] | |
assignments = [0 for _ in reservations] | |
available_cables = set(range(1, ncables + 1)) | |
aborted = False |