Skip to content

Instantly share code, notes, and snippets.

@vitalybe
vitalybe / gist:db36feb702d686cb53b7
Created May 8, 2014 07:54
Controller structure
app.controller('DemoController', function ($scope, MyService) {
var _count = 0;
function _privateUtil() { // function decomposition
_count += _count + 1;
}
function _handleClick(data) {
_privateUtil();
$scope.answer = MyService.doSomething({
@vitalybe
vitalybe / gist:b8b3714e0b2f3b099ac1
Created May 8, 2014 08:10
Suggested controller/service structure
{
// private field init
var a = 1;
// public field init
$scope.b = 1; // For controllers
this.c = 1; // For services
// call init function
init();
{
// private field init
var a = 1;
// Initialization logic is here
if () {
...
}
// Private functions
@vitalybe
vitalybe / index.html
Created November 24, 2014 20:50
Vitaly final // source http://jsbin.com/moqocu/15
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Vitaly final" />
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
div {
height: 100px;
width: 100px;
@vitalybe
vitalybe / gist:aad75b23da636e615248
Created February 24, 2015 11:24
PR-list example
ID | Last SHA | Owner | Branch | Title
---- | ---------- | --------------- | ------------------------------ | ----------------------------------------
197 | 9287bb6 | jkirkpatrick | qa | Protractor tests with multiple chrome profiles
150 | 8791ab9 | oliversalzburg | feature/strict-di | fix(strictdi): Use strict DI wherever possible
136 | d2ca167 | itsananderson | fix-strict-di | Annotate config and decorator to avoid strictDI errors
120 | bab8b92 | jayhogan | bindings | Show element binding expressions in the sidebar panel alongside
118 | 1642b4a | hupfis | master | Use outline instead of border to keep layout
111 | 4498e13 | blackxored | add-class-to-inspector | Add class to floating inspector
106 | 9537399 | rpl | prototype/firefox-devtools-port| WIP: port to Firefox
105 | 0e55aef | caitp
@vitalybe
vitalybe / .gitconfig
Created February 25, 2015 12:28
Awesome git aliases
safereset = "!f() { \
trap 'echo ERROR: Operation failed; return' ERR; \
echo Making sure there are no changes...; \
last_status=$(git status --porcelain);\
if [[ $last_status != \"\" ]]; then\
echo There are dirty files:;\
echo \"$last_status\";\
echo;\
echo -n \"Enter D if you would like to DISCARD these changes or W to commit them as WIP: \";\
read dirty_operation;\
tell application "iTerm"
-- Create a new terminal window or tab.
set myterm to (make new terminal)
tell myterm
-- Create a new session.
set mysession to (make new session at the end of sessions)
@vitalybe
vitalybe / mochaIntellijReporter.js
Created September 12, 2016 07:02
changed mochaIntellijReporter.js file that shows links to files
let fs = require("fs");
let path = require("path");
let process = require("process");
var Tree = require('./mochaIntellijTree')
, util = require('./mochaIntellijUtil')
, treeUtil = require('./mochaTreeUtil')
, normalizer = require('./normalizer');
/**
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
# Make sure you have a recent version: the code points that Powerline
@vitalybe
vitalybe / .tigrc
Created June 27, 2017 05:44
My .tigrc
#########
# GENERIC
#########
# git - generic
bind generic g ?sh -c "git %(prompt git )"
######
# MAIN
######