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
| #!/bin/sh | |
| ### | |
| # cdalias | |
| ### | |
| # Makes an alias for cd'ing to the current directory. |
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
| function interceptFunction (object, fnName, options) { | |
| var noop = function () {}; | |
| var fnToWrap = object[fnName]; | |
| var before = options.before || noop; | |
| var after = options.after || noop; | |
| object[fnName] = function () { | |
| before.apply(this, arguments); | |
| var result = fnToWrap.apply(this, arguments); | |
| after.apply(this, arguments); |
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
| DATE=$(date +"%Y-%m-%d--%H-%M-%S") |
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
| // load the $http module | |
| var $http = angular.injector(["ng"]).get("$http"); | |
| $http. |
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
| while [[ ! $RELATIVE_PATH_CHECKED =~ ^[Yy]$ ]] | |
| do | |
| read -p "Is the relative path to the dev folder '${RELATIVE_PATH}' correct? [y/n] " -n 1 -r RELATIVE_PATH_CHECKED | |
| echo "" | |
| if [[ $RELATIVE_PATH_CHECKED =~ ^[Nn]$ ]] | |
| then | |
| read -p "Type in the correct path: " -r RELATIVE_PATH | |
| fi | |
| done |
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 scopeElements = Array.prototype.slice.apply(document.querySelectorAll(".ng-scope")); | |
| var scopes = scopeElements.map(function (element) { | |
| return angular.element(element).scope(); | |
| }); | |
| var scopeIds = scopes.map(function(scope) { | |
| return scope.$id; | |
| }); | |
| var uniqueScopeIds = scopeIds.filter(function(scopeId, index){ | |
| return scopeIds.indexOf(scopeId) === index; | |
| }); |
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
| function interceptFunction (object, fnName, options) { | |
| var noop = function () {}; | |
| var fnToWrap = object[fnName]; | |
| var before = options.before || noop; | |
| var after = options.after || noop; | |
| object[fnName] = function () { | |
| before.apply(this, arguments); | |
| var result = fnToWrap.apply(this, arguments); | |
| after.apply(this, arguments); |
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
| function interceptFunction (object, fnName, options) { | |
| var noop = function () {}; | |
| var fnToWrap = object[fnName]; | |
| var before = options.before || noop; | |
| var after = options.after || noop; | |
| object[fnName] = function () { | |
| before.apply(this, arguments); | |
| var result = fnToWrap.apply(this, arguments); | |
| after.apply(this, arguments); |
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
| function analyseScopeAndWatchers() { | |
| // fetch all elements with ng-scope class | |
| var scopeElements = Array.prototype.slice.apply(document.querySelectorAll(".ng-scope")); | |
| // map elements to scopes | |
| var scopes = scopeElements.map(function (element) { | |
| return angular.element(element).scope(); | |
| }); | |
| // filter duplicated scopes created by ng-view |
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
| #!/bin/bash | |
| # | |
| # Bash script to setup headless Selenium (uses Xvfb and Chrome) | |
| # (Tested on Ubuntu 12.04) trying on ubuntu server 14.04 | |
| # Add Google Chrome's repo to sources.list | |
| sudo add-apt-repository ppa:chromium-daily/stable | |
| sudo apt-get update | |
| #echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list |
OlderNewer