Skip to content

Instantly share code, notes, and snippets.

View asciidisco's full-sized avatar
🏠
Working from home

Sebastian Golasch asciidisco

🏠
Working from home
View GitHub Profile
@asciidisco
asciidisco / js-iot.md
Last active August 29, 2015 14:16
Tales from the crypt: JavaScript & the Internet of Things

Tales from the crypt: JavaScript & the Internet of Things

Let`s face the truth, "The Internet of Things" (or IoT like the all the cool cats say) isn't more than a fancy buzzword. Interestingly though, it is used by two different groups of people, one wants to "shove big data into the cloud" and the other group builds DIY software & hardware to control their coffee machine using a Tessel backed up by an Raspberry PI.

If we dive deeper into this topic, looking for a common ground both groups build upon, we see the same questions bubbling up: Is my battery powered motion detector really connected to the internet? If all these devices belong to the category "Internet of Things", why do I need a vendor specific access point to control them? Does my cloudy big data lightbulb producer know when I turn on the lights? And very important: Why doesn't this "Internet of Things" work in my browser? Do I really need 20 iPhone apps to turn stuff on and off?

On the meta level, all these questions could be answered wi

@asciidisco
asciidisco / index.js
Last active March 15, 2018 23:06
UPNP discovery
var ssdp = require('node-ssdp-lite');
var request = require('request');
var _ = require('lodash');
var parseString = require('xml2js').parseString;
var client = new ssdp();
var endpoints = {};
var locationFilter = function (msg) {
var start = msg.search('LOCATION:') + 'LOCATION:'.length;
@asciidisco
asciidisco / jnpm
Created December 10, 2014 12:07
jQuery NPM Package Contents
|-- AUTHORS.txt
|-- CONTRIBUTING.md
|-- MIT-LICENSE.txt
|-- README.md
|-- bower.json
|-- dist
| |-- cdn
| |-- jquery.js
| |-- jquery.min.js
| `-- jquery.min.map
@asciidisco
asciidisco / gruntfile.js
Created October 29, 2014 12:53
grunt-sass multifile
sass: {
dist: {
files: {
'src/css/main.css': 'src/scss/main.scss',
'src/css/main2.css': 'src/scss/main2.scss'
}
}
},
'use strict';
module.exports = {
'Can move data around': function (test) {
test.open('http://localhost:5001/about.html')
// executed in browser scope
.execute(function () {
var message = Math.random().toString(36).substring(7);
this.data('lastMessage', message);
@asciidisco
asciidisco / dalek_random.js
Created July 9, 2014 14:34
Fetching a random element
'use strict':
var randomPickMe = function (arr) {
return arr[Math.floor((Math.random()*arr.length))];
};
var elements = ['div', 'p', '.someClass', '#anid', 'span a'];
module.exports = {

Keybase proof

I hereby claim:

  • I am asciidisco on github.
  • I am asciidisco (https://keybase.io/asciidisco) on keybase.
  • I have a public key whose fingerprint is 6522 51A3 ED08 44B6 F854 31BE C359 803B ACA6 CFD7

To claim this, I am signing this object:

// how to install/first steps http://dalekjs.com/pages/getStarted.html#install
// how to use it within grunt: https://www.npmjs.org/package/grunt-dalek
module.exports = {
'Can access the DOM': function (test) {
test.open('http://dalekjs.com/')
// the execute method executes JavaScript within a browser & also has
// full access to the DOM
.execute(function (message) {
// the "data" method is a simple wrapper around a key/value store
var myLoopedFn = function (test) {
test.open('http://google.de')
.click('#hugendubel')
.assert.text('#hugendubel', 'Steinlaus')
.wait(2000)
.assert.text('#hugendubel', 'Weinlaus')
.done();
};
var myObj = {};
Headline: Local Bower Registry
Description: As a developer, I want to be able to maintain & version private modules & dependencies in the frontend
Estimation: 8SP
Acceptance criteria:
∆ A local bower registry is up & running
∆ The registry can be accessed from the developer machine (onsite & from home office)
∆ The CI server can access the registry
∆ Modules can be uploaded
∆ Modules are stored in every version ever published