Skip to content

Instantly share code, notes, and snippets.

View domderen's full-sized avatar

Dominik Deren domderen

  • Hyperion Gray
  • Poland
View GitHub Profile
# dockerhub - A repository for various dockerfiles
# For more information; http://github.com/cmfatih/dockerhub
#
# SlimerJS
#
# Test
# sudo docker run fentas/slimerjs /usr/bin/slimerjs -v
# sudo docker run fentas/slimerjs /usr/bin/casperjs | head -n 1
# sudo docker run -v `pwd`:/mnt/test fentas/slimerjs /usr/bin/slimerjs /mnt/test/test.js
function * getResponses(urls) {
const responses = urls.map(url => yield getServerResponse(url));
return responses;
}
function getValues () {
return {
a: 1,
b: 2
};
}
let {a, b} = getValues();
console.log(a, b);
const fun = ({param1 = 'some default value', param2 = 'other default value'} = {}) => {
console.log(param1);
console.log(param2);
console.log(options); // Can I somehow get access to the object that has param1 and param2 inside?
console.log(arguments[0]); // Is this the only way?
};
@domderen
domderen / Angular Overlay Directive
Created August 6, 2014 20:14
Angular directive for creating dynamic overlays over any element. Directive is automatically preparing parent to have an overlay, and dynamically sets the height of the overlay if the height of the parent will change. Second directive allows to set any element in the vertical and horizontal center of the parent element. It dynamically reposition…
var overlayModule = angular.module('angular-overlay', []).directive('elementOverlay', [function () {
return {
restrict: 'A',
link: function (scope, elem, attrs) {
$(elem[0].parentNode).css('position', 'relative');
scope.$watch(function () {
return $(elem[0].parentNode).height();
}, function (v) {
elem.css('height', v + 'px');
@domderen
domderen / install.sh
Last active April 17, 2022 06:28
Installation of apache spark on ubuntu machine.
#!/bin/sh
# installation of Oracle Java JDK.
sudo apt-get -y update
sudo apt-get -y install python-software-properties
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get -y update
sudo apt-get -y install oracle-java7-installer
# Installation of commonly used python scipy tools