### jquery
<script src="/jquery/dist/jquery.slim.min.js"></script>
var net = require('net') | |
var PORT = process.argv[2] | |
var strftime = require('strftime') | |
var server = net.createServer( function(socket) { | |
var formattedDate = strftime('%Y-%m-%d %H:%M') + '\n' | |
socket.end(formattedDate) | |
}) | |
server.listen(PORT) |
<!DOCTYPE html> | |
<html lang="en" ng-app="myApp"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<style type="text/css"> | |
.highlight { | |
background: yellow; | |
} | |
</style> |
const isDuplicated = (element, i, array) => { | |
return array.filter( item => item === element).length > 1 | |
} | |
const countries = ['Namibia','Niger','Palau','Macedonia','Brazil','Czech Republic','Mauritania','Canada','Sweden','Afghanistan','Singapore','Azerbaijan','Turkmenistan','Sao Tome and Principe','Denmark','Mongolia','Switzerland','St. Lucia','Nauru','Slovenia','Papua New Guinea','Cameroon','Iraq','Portugal','Zambia','Italy','Afghanistan','Burkina Faso','Dominica','Iceland','Serbia','Myanmar','Canada','Oman','United Kingdom','Tanzania','Jordan','Timor-Leste','Kosovo','Lithuania','Tuvalu','Palau','Latvia','Andorra','Belarus','Tajikistan','Indonesia','Hungary','Cambodia','Israel','Bangladesh','Peru','Moldova'] | |
countries | |
.map( isDuplicated ) |
# Ionic Application Structure
After running the ionic start
command, the Ionic CLI will generate a handful of files & folders for your new app. They span across a couple of different aspects of your hybrid app development and are worth being aware of.
Lets break them down one by one:
bower.json
: Used for managing your app's dependencies via the bower package management tool. By default, the Ionic Framework is the only dependency, but you can add more as needed.config.xml
: This is the configuration file for Cordova. It's used for Cordova plugin management and app settings.gulpfile.js
: This file is used for compiling SASS and other Ionic Framework specific tasks via the gulp task runner.var util = require("util"); | |
var EventEmitter = require("events").EventEmitter; | |
util.inherits(UserList, EventEmitter); | |
var users = []; | |
function UserList() {} | |
UserList.prototype.addUser = function(user) { |
A quick overview of the node.js streams interface with basic examples.
This is based on @brycebaril's presentation, Node.js Streams2 Demystified
Streams are a first-class construct in Node.js for handling data.
Think of them as as lazy evaluation applied to data.