Skip to content

Instantly share code, notes, and snippets.

View afitterling's full-sized avatar

Alex Fitterling afitterling

View GitHub Profile

list services across nodes

docker node ps $(docker node ls -q) --filter desired-state=Running | uniq

attach to container by name filter

docker exec -it $(docker ps -f name=main_backend-admin -q) bash

@afitterling
afitterling / Dockerfile
Last active November 25, 2021 21:03
Dockerfile jupyter
FROM python:buster
RUN apt update
RUN apt install -y vim
RUN /usr/local/bin/python -m pip install --upgrade pip
RUN pip3 install jupyter
RUN \curl -sSL https://get.rvm.io | bash
RUN echo "PATH=$PATH:/usr/local/rvm/bin" >> /root/.bashrc
RUN . /root/.bashrc && rvm install ruby
@afitterling
afitterling / jupyter.md
Last active September 29, 2021 21:05
Jupyter Studio

Jupyter

https://jupyter-docker-stacks.readthedocs.io/en/latest/

start

docker run -p 8888:8888 -v $(pwd):/home/jovyan/work jupyter/scipy-notebook

docker run --network some-network --rm -p 8888:8888 -e JUPYTER_ENABLE_LAB=yes $* -v "${PWD}":/home/jovyan/work jupyter/datascience-notebook

@afitterling
afitterling / ValidationActionsStore.js
Last active August 29, 2015 14:10
A simple UI Biz validator (business logic validation) for Angular
'use strict';
// this validation store handles validation for ui (business) logic
angular.module('famousAngular')
.factory('ValidationActionsStore', ['$rootScope', function ($rootScope) {
var self = this;
self.validationStore = $rootScope.$new();
@afitterling
afitterling / AppStore.js
Last active August 29, 2015 14:10
A simple but safe appStore to be able to resolve in angular-router or ui-router when switching between states/pages
'use strict';
// build a global AppStore with Promises
angular.module('famousAngular')
.factory('AppStore', ['$rootScope', '$q', function ($rootScope, $q) {
var self = this;
self.appStore = $rootScope.$new();
<div class='btn-group' name='FIXME' ng-change='onChange' ng-model='treeItems' ng-required='true'>
<a class='btn btn-default dropdown-toggle' data-toggle='dropdown' href='#' ng-disabled='ngDisabled'>
{{currentValue.name || dropdownPlaceholder }}
<span class='caret'></span>
</a>
<ul class='dropdown-menu' ng-show='!ngDisabled'>
<li ng-repeat='model in treeItems'>
<li ng-if='model' ng-include="'node.html'"></li>
</div>
</li>
@afitterling
afitterling / confirmationValidation
Created July 1, 2013 22:09
Confirmation Validation <input name="xxx" ............> <input name="confirm_xxx" confirmationValidation="xxx" ..............>
.directive('confirmationValidation', function () {
return {
require: 'ngModel',
link: function (scope, elm, attrs, ctrl) {
var field = attrs.confirmationValidation // || ''; should contain input field (binding: name="xxx") to use as confirm validation
ctrl.$parsers.unshift(function (viewValue, $scope) {
var noMatch = viewValue != scope.signUpForm[field].$viewValue
ctrl.$setValidity('noMatch', !noMatch)
})
}