Skip to content

Instantly share code, notes, and snippets.

View mdix's full-sized avatar
🇩🇰

Marc Dix mdix

🇩🇰
View GitHub Profile
@mdix
mdix / one.js
Created January 31, 2014 11:43
Checking multiple links for attrib
'links href attrib should be set correctly': function(test) {
test.open('http://www.flipkart.com');
var numLinks = 10;
for (var i = 0; i <= numLinks; i++) {
test.assert.attr('.menubar a:nth-child(' + i + ')', 'href', 'data-tracking-id');
}
test.done();
}
@mdix
mdix / gist:8951435
Created February 12, 2014 07:39
$ iptables -L -v -n
Chain INPUT (policy ACCEPT 21M packets, 21G bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 13M packets, 21G bytes)
pkts bytes target prot opt in out source destination
@mdix
mdix / md.js
Last active August 29, 2015 13:56
md working again
var md = {
remove: function() {
this.remove.sickLeaveState = function() {
console.log('Removing sick leave state.');
return true;
}
return this.remove;
},
work: function() {
this.work.on = function(ticket) {
@mdix
mdix / sometest.js
Last active August 29, 2015 13:57
Extending a test
function reuseMe(test) {
test.open('lolcathost/somepage');
}
module.exports = {
'Body exists on the page and has the correct form': function (test) {
reuseMe(test);
test.assert.exists('body', 'Body exists on the page');
}
$ dalek log_message_test.js -l4
Running tests
Running Browser: PhantomJS
OS: mac unknown 32bit
Browser Version: 1.9.7
RUNNING TEST - "Should output a message"
☁ [USER] MESSAGE: TEST
✔ 0 Assertions run
✔ TEST - "Should output a message" SUCCEEDED
@mdix
mdix / gist:e353e4c2aecb979614b3
Created June 15, 2014 19:53
testing the router
inject(function($state) {
expect($state.routes['/equipmentLines'].controller)
.toBe('equipmentLinesController');
expect($state.routes['/equipmentLines'].templateUrl)
.toEqual('views/equipmentLines.html');
});
@mdix
mdix / sample.scss
Last active August 29, 2015 14:06
Getting nested values with map-get
$colors: (
metanav_bordertop: (
one: red,
two: blue
)
);
body {
color: map-get(map-get($colors, metanav_bordertop), one);
@mdix
mdix / SassMeister-input.scss
Created September 17, 2014 12:11
Generated by SassMeister.com.
// ----
// Sass (v3.4.4)
// Compass (v1.0.1)
// ----
$colors: (
metanav_bordertop: (
cromax: #F00000,
standox: #1B2B79,
powder: #B00008,
@mdix
mdix / some.scss
Last active August 29, 2015 14:06
Some way to have two keys for one value / map?
$map: (
key1/key2: 'value'
)
@mdix
mdix / maps.scss
Last active August 29, 2015 14:06
Nested maps
$brands: (
salame,
tonno,
margharita,
hawai
);
$colors: (
primary_links_and_primary_buttons: (
salame: #E63C28,