Skip to content

Instantly share code, notes, and snippets.

View aantipov's full-sized avatar

Alexey Antipov aantipov

View GitHub Profile
@aantipov
aantipov / iterm2-solarized.md
Last active October 8, 2019 09:12 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@aantipov
aantipov / react2ng1.js
Last active October 4, 2022 18:52
A simple way to convert React components into AngularJS components
import React from "react";
import ReactDOM from "react-dom";
import { fromPairs, map, pick } from "ramda";
/**
* Wraps a React component into Angular component. Returns a new Angular component.
*
* Usage: angular.module('some.module').component('newAngularComponent', react2angular(MyReactComponent))
* (the usage is the same as in similar lib https://github.com/coatue-oss/react2angular)
*/
@aantipov
aantipov / ManageTeamCtrl
Created July 4, 2015 10:21
An example of angular.js controller written in ES6
const _deps = [
'$scope',
'$log',
'$state',
'notify',
'GuinnessApi',
'campaign',
'campaignUsers',
'teamMembers',
'user'
@aantipov
aantipov / dialogs.controller.coffee
Created April 3, 2015 09:24
An example of angular.js controller written in CoffeeScript
###
Dialogs Controller
@author Alexei Antipov <antipov.alexei@gmail.com>
###
define [], () ->
'use strict'
class DialogsCtrl
@aantipov
aantipov / HikesFormController
Created March 15, 2015 19:18
Example of a form controller from angular.js project
angular.module('lk').controller('HikesFormCtrl', Controller);
function Controller(city, languagesData, hike, $state, $scope, $upload, settings, toastr, $http) {
var self = this;
var uploadedImageId;
self.isNew = !hike.id;
self.data = hike;
self.imageState = {
name: '',
@aantipov
aantipov / HikeController.js
Created March 15, 2015 19:05
Examle of a controller from my sails.js project
'use strict';
/**
* Module dependencies
*/
var actionUtil = require('sails/lib/hooks/blueprints/actionUtil');
var util = require('util');
/**
* HikeController
@aantipov
aantipov / sails_find_blueprint
Created February 24, 2015 19:57
Custom find blueprint for sails.js. Get total records count and sent it via X-Total-Count header
'use strict';
/**
* Module dependencies
*/
var actionUtil = require('sails/lib/hooks/blueprints/actionUtil'),
_ = sails.lodash;
var async = require('sails/node_modules/async');
/**
'use strict';
angular.module('convertiser.components.manager')
.directive('changeStatus',
function ($state,
$modal,
gettextCatalog,
flash,
alertHelper,
@aantipov
aantipov / directve.transclude
Created September 14, 2014 09:12
Example of directive with the use of transcludeFn
'use strict';
angular.module('angularjs.module')
.directive('multiSelect', function ($modal, $templateCache, gettextCatalog) {
return {
restrict: 'A',
priority: 1000,
scope: {
'use strict';
angular.module('ccApp')
.factory('Popover',
function ($compile, $templateCache, $timeout, $http) {
var popoverEnabled = true, openTimeout, $popover, $layer, popoverTarget;
function isPopoverVisible() {
return $popover.is(':visible');
}