Skip to content

Instantly share code, notes, and snippets.

View e-oz's full-sized avatar
🕊️

Evgeniy OZ e-oz

🕊️
View GitHub Profile
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
@e-oz
e-oz / locator.attr.js
Created December 28, 2014 20:12
Protractor locator to find element(s) by value of attribute
by.addLocator('attr',
/**
* Find element(s), where attribute = value
* @param {string} attr
* @param {string} value
* @param {Element} [parentElement=]
* @returns {Array.<Element>}
*/
function (attr, value, parentElement) {
parentElement = parentElement || document;
@e-oz
e-oz / ptor.click.option.js
Created December 30, 2014 11:57
Protractor helper function: Click option[index] of select element
/**
* Click option[index] of select element
* @param select
* @param index
* @returns {protractor.promise}
*/
function clickOption(select, index) {
var deferred = protractor.promise.defer();
select.click().then(function () {
var options = select.all(by.css('option'));
@e-oz
e-oz / gist:96e626f7b8b9eaa5dcea
Created March 9, 2015 01:08
Importing dependencies in Angular 2 templates
'use strict';
// @ngInject
function exmpNavigation($state) {
return {
restrict: '',
templateUrl: 'components/exmpNavigation/template.html',
controllerAs: 'cNav',
controller: function () {
this.go = function (route) {
'use strict';
// @ngInject
function UserEventsLog($resource, Config, Token) {
return $resource(Config.apiUrl + '/user_events/:token', {token: Token.get()}, {
count: {
method: 'GET',
url: Config.apiUrl + '/user_events/count/:token',
isArray: false,
transformResponse: function (data) {
@e-oz
e-oz / Angular-Material-Complex-Dialog.markdown
Created May 2, 2015 21:41
Angular Material Complex Dialog
@e-oz
e-oz / Material Tabs & hRefs.markdown
Created July 22, 2015 00:18
Material Tabs & hRefs
@e-oz
e-oz / gist:1814226
Created February 13, 2012 06:22
old sypex geo with caching
<?php
namespace Sypex\Geo;
/***************************************************************************\
| Sypex Geo version 1.0.0 beta 2 |
| (c)2006 zapimir zapimir@zapimir.net http://sypex.net/ |
| (c)2006 BINOVATOR info@sypex.net |
|---------------------------------------------------------------------------|
| created: 2006.10.17 18:33 modified: 2006.10.26 22:07 |
|---------------------------------------------------------------------------|
@e-oz
e-oz / redis.init.d
Last active November 9, 2015 16:14
#!/bin/sh
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/6379.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis_6379.pid