Skip to content

Instantly share code, notes, and snippets.

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

Evgeniy OZ e-oz

🕊️
View GitHub Profile
@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 / player.js
Created February 22, 2013 07:35
for webinar
// Host where all mp3 files are located
var musicHost = 'http://player.tupi.ca/webinar/music/';
// List of available files
var files = [
'Chris_de_Burgh_-_The_Snows_Of_New_York.mp3',
'Metallica_-_Nothing_Else_Matters.mp3',
'R.E.M._-_Losing_My_Religion.mp3',
'Scooter_-_How_much_is_the_fish.mp3',
'Skrillex_-_Scary_Monsters_and_Nice_Sprites.mp3'
@e-oz
e-oz / folders_structure_idea.md
Last active December 20, 2015 22:38
Structuring an Angular Project

Author of quoted text: Colin Johnsun
Original: http://www.johnpapa.net/structuring-an-angular-project/#comment-142821

I agree with Joel, I found that dividing by functional area made more sense to my workflow.
I tend to work on a particular function in my application and having all related code in the same folder made it easy and quicker to locate them. In my Angular apps, I don’t have separate controller and views folders. Instead, I would have a folder for login, sales, shipping, etc which would contain my related controllers and views. Although I do group by types for services and directives.
Ward mentions about cross cutting concerns. For me, Angular feels more like an MVVM framework than MVC and in my apps, the controllers are the view-models. In the “Shipping” and “Sales” module example, I would have a shipping controller and a sales controllers for each of the respective modules. If the notion of “customer” is roughly the same in both modules then this notion of customer can be abstracted out i

for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
@e-oz
e-oz / locator.link.js
Last active November 29, 2018 23:20
Protractor locator to find <a> element by href attribute
@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) {