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 class="no-js"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <title></title> | |
| <meta name="description" content=""> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| </head> |
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
| /**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| * Anchor Smooth Scroll - Smooth scroll to the given anchor on click | |
| * adapted from this stackoverflow answer: http://stackoverflow.com/a/21918502/257494 | |
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ | |
| angular.module('yourapp').directive('anchorSmoothScroll', function($location) { | |
| 'use strict'; | |
| return { | |
| restrict: 'A', | |
| replace: false, |
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 config = { | |
| version: '3.1.4' | |
| }; | |
| // Frontend | |
| if (window) { | |
| window.config = config; | |
| // Backend | |
| } else if (typeof module !== 'undefined' && module.exports) { |
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 getJSON = require('get-json'); | |
| var APIs = [ | |
| 'http://lullabytunes.org/api.json', | |
| 'http://tevlihev.org/api.json', | |
| 'http://kizilok.org/api.json' | |
| ]; | |
| var Song = function(title, album, url) { | |
| this.title = title; |
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
| class Game { | |
| constructor() { | |
| ... | |
| // kick off our generator game flow | |
| this.flowGen = this.flow(); | |
| this.flowGen.next(); | |
| ... | |
| } | |
| ... |
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
| const size = parseInt(process.argv[2], 10); | |
| const index = parseInt(process.argv[3], 10); | |
| if (!size) { | |
| throw new Error('Must provide size of array as first argument.'); | |
| } | |
| if (index < 0 || index >= size) { | |
| throw new Error('Must provide a valid index to remove at as second argument.'); | |
| } |
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
| const size = parseInt(process.argv[2], 10); | |
| const index = parseInt(process.argv[3], 10); | |
| if (!size) { | |
| throw new Error('Must provide size of array as first argument.'); | |
| } | |
| if (index < 0 || index > size) { | |
| throw new Error('Must provide a valid index to insert at as second argument.'); | |
| } |
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
| const size = parseInt(process.argv[2], 10); | |
| const index = parseInt(process.argv[3], 10); | |
| if (!size) { | |
| throw new Error('Must provide size of array as first argument.'); | |
| } | |
| if (index < 0 || index >= size) { | |
| throw new Error('Must provide a valid index to access at as second argument.'); | |
| } |
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
| const md5 = require('md5'); | |
| const size = parseInt(process.argv[2], 10); | |
| if (!size) { | |
| throw new Error('Must provide size of object as first argument.'); | |
| } | |
| console.log(`Initializing object of size ${size}...`); |
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
| import 'package:flutter/cupertino.dart'; | |
| void main() => runApp(MyApp()); | |
| class MyApp extends StatelessWidget { | |
| static List<Widget> _getList(int length) { | |
| final List<Widget> list = List<Widget>(length); | |
| for (int i = 0; i < length; i++) { | |
| list[i] = _getListItem(i); | |
| } |