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 names = ['Alice', 'Bob', 'Tiff', "Sonny", 'Bruce', 'Alice', "Sonny"]; | |
//output shoule be { 'Alice': 2, 'Bob': 1, 'Tiff': 1, 'Bruce': 1 } | |
var initialValue = {}; | |
var reducer = (names, stats) => { | |
(!names[stats]) ? names[stats] = 1 | |
: names[stats] = names[stats] + 1; |
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
let faker = require('faker') | |
const getRandom = (arr) => arr[Math.floor(Math.random()*arr.length)] | |
const createCombos = (foodNames, foodTypes) => foodNames.map( (item, index) => `${getRandom(foodTypes)} ${item}`) | |
const foodNames = ['Samosa', 'Sandwich', 'Roll', 'Pattice'] | |
const foodTypes = ['Non Veg', 'Veg', 'Jain'] | |
function Combo() { | |
return { |
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
function processMovieDetailsResponse(movie) { | |
const movieDetailTemplate = ` | |
<div class="movie-detail" data-movie-id="${movie.id}"> | |
<p><strong>${movie.original_title}</strong></p> | |
<img src="https://image.tmdb.org/t/p/w185${movie.poster_path}" /> | |
<p> | |
<em>Genres:</em> | |
<ul> | |
${displayGenres(movie.id, movie.genres)} | |
</ul> |
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 webpack = require('webpack'); | |
const path = require('path'); | |
module.exports = { | |
entry: './app/src/index.js', | |
output: { | |
path: './app/build', | |
filename: 'bundle.js', | |
publicPath: '/' | |
}, |
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
export default class App extends React.Component { | |
render() { | |
return ( | |
<View style={styles.container}> | |
<Text>Open up App.js to start working on your app!</Text> | |
<Text style={styles.bigblue}>Changes you make reload.</Text> | |
<Text>Shake your phone to open the developer menu.</Text> | |
</View> | |
); | |
} |
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
function Interface(input, output, completer, terminal) { | |
if (!(this instanceof Interface)) { | |
return new Interface(input, output, completer, terminal); | |
} | |
this._sawReturnAt = 0; | |
this.isCompletionEnabled = true; | |
this._sawKeyPress = false; | |
this._previousKey = null; |
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
<?php | |
namespace Craft; | |
// This file could be placed into your public_html folder and visited to import a cheese product. | |
$craft = require '../craft/app/bootstrap.php'; | |
$craft->plugins->loadPlugins(); | |
$newProduct = new Commerce_ProductModel(); |
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
<!-- You need to follow the template of plugin to create html code --> | |
<!-- The link to show/hide slideout menu --> | |
<!-- Note href point to the actual slideout menu --> | |
<header> | |
<nav> | |
<ul class="main_menu"> | |
<li class="logo"><a href="#">Aranca</a></li> | |
<li class="sidr__menu"><a id="simple-menu" href="#sidr"><i class="fa fa-bars"></i></a></li> | |
<li class="home"><a href="#"><i class="fa fa-home"></i></a></li> |
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
RewriteEngine On | |
RewriteBase / | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] |
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
<div class="page"> | |
<header> | |
<a class="logo" href="#"><img src="http://app.reminderbear.com/assets/images/panda-bear-large.png"></a> | |
<h1 class="company-name">Pandas 'R Us</h1> | |
<nav> | |
<ul> | |
<li class="nav-item"><a href="#">Nav 1</a></li> | |
<li class="nav-item"><a href="#">Nav 2</a></li> | |
<li class="nav-item"><a href="#">Nav 3</a></li> | |
<li class="nav-item"><a href="#">Nav 4</a></li> |