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 / nha.md
Last active October 20, 2017 20:06
Node homeautomation
@asciidisco
asciidisco / simple_koa_spdy_ws.js
Created December 31, 2013 13:12
simple_koa_spdy_ws.js
var spdy = require('spdy');
var WebSocket = require('ws');
var koa = require('koa');
var fs = require('fs');
var views = require('co-views');
// spdy key data
var options = {
key: fs.readFileSync(__dirname + '/keys/server.key'),
cert: fs.readFileSync(__dirname + '/keys/server.crt'),
@asciidisco
asciidisco / whattheperl
Created January 3, 2014 16:48
Converting this line of perl to javascript...
@{$hashQ->{apIDs}}=grep !/$id/,@{$hashQ->{apIDs}};

I have an error compiling sassc with Emscripten, maybe someone is able to point me to the failure or has an idea what I might be doing wrong here...

If I just compile sassc the "normal" way, everything works as expected.

Here are the steps I made (and their output):

$ export SASS_LIBSASS_PATH=/Users/asciidisco/Downloads/sassc/libsass
@asciidisco
asciidisco / functions.js
Last active February 23, 2016 10:28
Reuse tests or navigation functions across DalekJS files
module.exports = {
loginLocal: function (test) {
test
.open('http://thefalloftheeleventh.com')
.type('[name="user"]', 'John Smith')
.type('[name="pass"]', 'tardis')
.click('button[type="submit"]')
.done();
},
@asciidisco
asciidisco / gist:8731237
Last active August 29, 2015 13:55
Check existence of attributes with Dalek
test.execute(function () {
var nl = document.querySelectorAll(".menubar a[href]");
var as = Array.prototype.slice.call(nl);
as.foreach(function (el) {
var attr = el.getAttribute('data-tracking-id');
this.assert.ok((attr !== null), 'Attribute exists for:' + el.outerHTML);
}.bind(this))
})
// given that the Logout function looks something like this:
// contents of functions.js
module.exports = {
Logout: function (aVar, bVar, test) {
console.log('Im logging the 2nd argument, just for fun:', bVar);
test
.click('#logout' + aVar)
.done();
}
};
@asciidisco
asciidisco / iap.js
Created March 11, 2014 13:18
Integrated Appium Server
// using appium 0.9.something it was paossible to do this
// appium server (this file doesn't exist anymore)
var appium = require('appium/server');
// some args
var appiumArgs = {
app: null,
ipa: null,
quiet: true,
@asciidisco
asciidisco / dcu.js
Created March 28, 2014 17:25
Dalek/Chosen urghhh
'use strict';
module.exports = {
'Can fill out form': function (test) {
test.open('http://tentoring.com/')
.type('#name', 'Sebastian Golasch')
.type('#email', 'public@asciidisco.com')
.execute(function () {
// use "in Browser" javascript to select the items
@asciidisco
asciidisco / collect_links.js
Created March 30, 2014 23:15
This code is not tested, but at least should give you an inspiration on how to solve your issue.