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
<html> | |
<head> | |
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" /> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> | |
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script> | |
<style> | |
#llmap { |
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
from numpy import genfromtxt | |
from time import time | |
from datetime import datetime | |
from sqlalchemy import Column, Integer, Float, Date, String, VARCHAR | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy import create_engine | |
from sqlalchemy.orm import sessionmaker | |
import csv | |
import pandas |
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
/*jshint esversion: 6 */ | |
require('dotenv').config(); | |
var axios = require('axios'); | |
const getToken = () => { | |
const sessionEndpoint = 'https://api.etilbudsavis.dk/v2/sessions'; | |
return new Promise(function (fullfill, reject) { | |
axios.post(sessionEndpoint, { | |
api_key: process.env.API_KEY, | |
token_ttl: 256, |
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
Homework: | |
--------- | |
In classs you learned about IIFE's, encapsulation and object oriented programming. | |
You also worked on a example calling library_a.render() and library_b.render(). | |
IIFE's are good for grouping related code in a namespace. Let's say that you have some math related functions . Then | |
you could do: | |
var Math = (function () { | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Exploring JavaScript (Hack Your future Copenhagen)</title> | |
<script src="node_modules/jquery/dist/jquery.js" charset="utf-8"></script> | |
<script src="node_modules/bootstrap/dist/js/bootstrap.js" charset="utf-8"></script> | |
<script src="node_modules/bootstrap-select/dist/js/bootstrap-select.js" charset="utf-8"></script> | |
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.css" /> | |
<link rel="stylesheet" href="node_modules/bootstrap-select/dist/css/bootstrap-select.css" /> |
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="container"> | |
<form class="form-horizontal" role="form"> | |
<div class="form-group"> | |
<span class="col-sm-2 control-label" for="name">name</span> | |
<div class="col-sm-10"> | |
<input class="form-control" type="text" name="name" id="name" /> | |
</div> | |
</div> | |
<div class="form-group"> | |
<span class="col-sm-2 control-label">type</span> |
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>JavaScript functions+lists+strings (Hack Your future Copenhagen)</title> | |
<script src="bower_components/jquery/dist/jquery.js" charset="utf-8"></script> | |
<script src="bower_components/bootstrap/dist/js/bootstrap.js" charset="utf-8"></script> | |
<script src="bower_components/bootstrap-select/dist/js/bootstrap-select.js" charset="utf-8"></script> | |
<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css"> |
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 jsdom = require("jsdom"); | |
jsdom.env({ | |
url: "http://www.meetup.com/Elasticsearch-Copenhagen-Meetup/events/221911024/", | |
scripts: ["http://code.jquery.com/jquery.js"], | |
done: function (errors, window) { | |
var $ = window.$; | |
var title = $('title').text(); | |
var startDate = $($('time[itemprop=startDate]')[0]).attr('datetime'); | |
var site = $($('#event-where')[0]).data('name'); |
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
// Run this to receive a png image stream from your drone. | |
var arDrone = require('ar-drone'); | |
var cv = require('opencv'); | |
var http = require('http'); | |
var fs = require('fs'); | |
console.log('Connecting png stream ...'); | |
//var stream = arDrone.createUdpNavdataStream(); |
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 search ="http://dawa.aws.dk/adresser"; | |
$( "#address" ).autocomplete({ | |
source: function( request, response ) { | |
$.ajax({ | |
url : search, | |
dataType: "jsonp", | |
data: { | |
q: $('#address').val() + "*", | |
format: "geojson" | |
}, |
NewerOlder