- Create a new directory with these three files (requirements.txt, main.py, README.md)
python -m venv venvsource venv/bin/activatepip install -r requirements.txtpython main.py- Update
main()to run the example prompt chains
This file contains hidden or 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
| # An example of Functional Reactive Programming, by implementing a | |
| # simple collaborative piano. | |
| # By Mikael Brevik <@mikaelbr> | |
| socket = io.connect() | |
| scale = [ | |
| 'A2', 'Bb2', 'B2', 'C3', 'Db3', 'D3', 'Eb3', 'E3', 'F3', 'Gb3', 'G3', 'Ab3', | |
| 'A3', 'Bb3', 'B3', 'C4', 'Db4', 'D4', 'Eb4', 'E4', 'F4', 'Gb4', 'G4', 'Ab4', | |
| 'A4', 'Bb4', 'B4', 'C5' |
This file contains hidden or 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 file/module contains all configuration for the build process. | |
| */ | |
| /** | |
| * Load requires and directory resources | |
| */ | |
| var join = require('path').join, | |
| bowerrc = JSON.parse(require('fs').readFileSync('./.bowerrc', {encoding: 'utf8'})), | |
| bowerJSON = bowerrc.json.replace(/^\.?\/?/, './'), |
This file contains hidden or 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 pkg = require("./package.json") | |
| , gulp = require("gulp") | |
| , gutil = require("gulp-util") | |
| , concat = require("gulp-concat") | |
| /// | |
| // HTML (Jade) | |
| /// | |
| var jade = require("gulp-jade") |
This file contains hidden or 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
| angular.module('myApp', | |
| ['ngRoute', 'myApp.services', 'myApp.directives'] | |
| ) | |
| .config(function(AWSServiceProvider) { | |
| AWSServiceProvider.setArn('arn:aws:iam::<ACCOUNT_ID>:role/google-web-role'); | |
| }) | |
| .config(function(StripeServiceProvider) { | |
| StripeServiceProvider.setPublishableKey('pk_test_YOURKEY'); | |
| }) | |
| .config(function($routeProvider) { |
This file contains hidden or 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 directives = angular.module('login.directive', []); | |
| directives.directive('login', ['$rootScope', '$compile', '$http', '$templateCache', | |
| function($location, $rootScope, $compile, $http, $templateCache) { | |
| ... | |
| definition.link = function postLink(scope, element, attrs) { |
This file contains hidden or 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 application_root = __dirname, | |
| express = require("express"), | |
| path = require("path"), | |
| mongoose = require('mongoose'); | |
| var app = express.createServer(); | |
| // database | |
| mongoose.connect('mongodb://localhost/ecomm_database'); |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Responsive Design Testing</title> | |
| <style> | |
| body { margin: 20px; font-family: sans-serif; overflow-x: scroll; } | |
| .wrapper { width: 6000px; } | |
| .frame { float: left; } | |
| h2 { margin: 0 0 5px 0; } |