dagda1

1

votes
1

answer
88

views

ie10 only media query

The following media query targets both ie10 and 1e11 @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { background-color: blue; } Is there a way to only target ie10.
dagda1
1

votes
1

answer
325

views

kill -9 does not kill nginx process in docker container

I am trying to start nginx, when I try and start nginx, I get this error: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) nginx: [emerg...
dagda1
1

votes
2

answer
44

views

two independent flexbox children with same height without javascript [duplicate]

This question already has an answer here: Equal height children of flex items 1 answer In the markup below, these left and right flexbox containers are scrollable so that users can compare details. I need would like a way of being able to have the child elements at the same index have the same heig...
dagda1
1

votes
1

answer
371

views

async componentWillMount in react 16.3

I have the following function that I use to tell if the user is authenticated: async componentWillMount() { this.setState({ busy: true }); const authorisationProvider = this.props.authorisationProvider; const currentSession = await authorisationProvider.getSession(); this.props.getUserAttributes();...
dagda1
1

votes
1

answer
21

views

node alternative to grunt async funciton

I am trying replace some very old grunt code with some plain node code. Some functions use done = this.async() to give a handle you can use to signify the work is done. How would I replace this with node code?
dagda1
1

votes
1

answer
18

views

the rules behind treeshaking with an npm module and webpack

If I have an npm package that exports all its components from 1 index.js file: export * from './components/A'; export * from './components/B'; Then if I have another package that consumes this package: import {A} from 'my-package'; Will the contents of components/B be bundled even though it is never...
dagda1
1

votes
1

answer
38

views

keep inquirer process alive when called from node shebang

I have a function like this: const runInteractive = (rows, dups) => { const keys = new Set(dups); const questions = _(rows) .filter(row => keys.has(row.key)) .groupBy(row => row.key) .map((rows, key) => ({ type: 'list', name: key.replace('.', ','), message: `Pick a value for ${key}`, choices: rows.m...
dagda1
1

votes
2

answer
61

views

how to use the svg matrix function to scale an svg back with the correct transform maths

If you look at the snippet below, I want to implement zooming on an svg image. I want it to gracefully zoom in and out. I am using the matrix function and I know I can scale back by changing the first and fourth or the matrix or a and d. Programmatically I am going to change the transform matrix bu...
dagda1
1

votes
0

answer
57

views

union type giving error message after upgrading to typescript 3.2.2

I have the following types that are used for React components: export interface AsyncRouteComponentState { Component: AsyncRouteableComponent | null; } export interface AsyncComponent { getInitialProps: (props: Ctx) => any; load?: () => Promise; } export interface AsyncRouteComponent extends AsyncCo...
dagda1
1

votes
1

answer
28

views

union of redux action types still allowing unknown type in

I have created this ts playground that shows the problem. I have this type: export type ApiActionCreator = T & { payload: Payload, error: ErrorMessage } Which I want to use to create redux action types, for example: export enum RoleActionTypes { GET_ALL = '@@role/GET_ALL', GET_ALL_OK = '@@role/GET_A...
dagda1
3

votes
2

answer
141

views

the relationship between scale when centering one svg element in an other

I have written these functions to center one svg element in another: import { Matrix, translate } from 'transformation-matrix'; export const getElementCenter = (element: SVGGraphicsElement) => { const bBox = element.getBBox(); return { x: bBox.x + bBox.width / 2, y: bBox.y + bBox.height / 2 }; }; ex...
dagda1
1

votes
4

answer
50

views

not using find twice when retrieving deeply nested object in javascript

I am able to find the object in the javascript below but it is pretty horrible and I am doing the find twice. I'd be interested in a better way and one that did not involve lodash which I am current not using. const statuses = [{ items: [{ id: 1, name: 'foo' }, { id: 5, name: 'bar' }] }, {...
dagda1
1

votes
1

answer
26

views

pass data between components in angular that all have the same parent route

I have a route like this: export const UploadsRoutes: Route[] = [ { path: UrlPaths.uploads, component: UploadsComponent, canActivate: [AuthGuard], children: [ { path: '', component: UploadsListComponent }, { path: 'new', component: FileUploadComponent } ] } ]; I want don't want to have to observe th...
dagda1
1

votes
0

answer
19

views

how to update 1 property in 1 object in an BehaviorSubject and let all observers know

If I have a BehaviorSubject which is a list of objects files$: BehaviorSubject = new BehaviorSubject([]); How can I update 1 property in 1 object of the list and notify all observers without doing something like: files$.next([files.map(f => { if(f === condition) { f.changed = true; } return f })]);...
dagda1
1

votes
1

answer
24

views

create azure function through code and not through the GUI

I have an azure function that I have 3 different environments for dev, staging and prod. I currently have a git kudu remote for each environment and if I push to that remote then the code gets deployed. I could not find anything OOTB in azure functions for this. One really annoying thing is that ea...
dagda1
1

votes
0

answer
16

views

typescript optional indexer type that returns same type

I have the following types: export enum KeyCode { Alt = 'meta', Command = 'command', Ctrl = 'ctrl', DownArrow = 'down', Enter = 'enter', Escape = 'esc', LeftArrow = 'left', Mod = 'mod', RightArrow = 'right', UpArrow = 'up' } export interface ShortcutAction { keys: string | string[]; action: string;...
dagda1
1

votes
1

answer
578

views

Address Parser for Ruby

Is anyone aware of an address parser plugin for Ruby? I might have to use one of the paid webservices but thought there might be a plugin. Another thought is go down the NLP route where I could build up a database over time. Does anybody use any NLP plugin for ruby? I want to use it to logically par...
dagda1
1

votes
2

answer
261

views

Ruby alternative to Service Layer

I am writing a Ruby on Rails app. which will use a 3rd party to do a webservice call or a rest call or some sort of call. I am not sold on which 3rd party I am going to use so I want to isolate this in some sort of facade. If I was doing this in .NET, I would isolate this functionality in a service...
dagda1
1

votes
1

answer
249

views

ASP.NET MVC 2 EditorFor rendering the wrong mark up

I have the following asp.net mvc2 template: ViewData.Model.TrainingTree, 'TrainingCategory')%> You can see that I want to bind it to a model of type TrainingLookUpContainer. The problem is, the following mark up is being generated: The bit I object to is the ViewData_Model_ prefix for the id of the...
dagda1
1

votes
1

answer
370

views

Does anyone actually use Ruby On Rails scaffolding?

I think I am missing the point of scaffolding, does anyone use RoR scaffolding and if so can they point me to any specific examples of how they use it? I am a big sass and compass fan, is it possible to incorporate this into scaffolding?
dagda1
1

votes
1

answer
754

views

Log events from another assembly in a seperate log4net log

I have the following log4net configuration Is it possible to log the events from a different assembly in a different file? For example, messages from Castle.Facilities.NhibernateIntegration If not that, is there a better way of filtering the events? I do not want to limit the stream to only errors.
dagda1
1

votes
1

answer
65

views

Ruby on Rails stubbing method when working on the view

I have an action that contains the following call: parser = Parser.new(open(@urlsearch.url)) The problem is that this is an expensive call and also relies on me having internet connectivity. When I am running this from a functional test, I can stub this call using mocha but I want to stub this when...
dagda1
1

votes
1

answer
130

views

WebSockets server that will complete the job after the connection is made - Ruby, Rails

I want to use something like EventMachine websockets to push status updates to the client as they happen. My application crawls round a section of a website screen scraping relevant details of a user's search. I want to push any screen scraping captures to the client as they happen. I also want to...
dagda1
1

votes
1

answer
142

views

openwrap and r#6.0

I have just updated my resharper plugin to R#6. My references are no longer being picked up from the wrap cache. I have to set my references manually. Is there anything I can do?
dagda1
1

votes
1

answer
413

views

find_by_sql in rails 3.1

I have the following code in my seeds.rb file in a jruby 1.6.3 rails 3.1 project which I invoke with rake db:seed Role.destroy_all User.destroy_all ['admin', 'standard'].each do |role| Role.find_or_create_by_name(role) end if User.find_by_email('[email protected]').nil? user = User.new user.email =...
dagda1
1

votes
1

answer
379

views

Queuing in tandem with a Ruby Web socket server

I am writing an application using jruby on rails. Part of the application initiates a long running process from a web page. The long running process could last for 20 minutes in some cases but will in most cases outlive a web page response in terms of time. I also want the job to continue if the...
dagda1
1

votes
1

answer
563

views

RabbitMQ and em-websocket

I am struggling to work out how I can communicate between rabbitmq and em-websocet. I want to place a message from a ruby on rails web page on a queue and have the queue handler process the message even if the browser is closed down. If the browser stays open, I want the results of the queue handle...
dagda1
1

votes
1

answer
516

views

Declaring backbone extension class in another file - coffeescript

I have the following class that extends Backbone.View, I want all my backbone views to inherit from this class: class BaseView constructor: (options) -> @bindings = [] Backbone.View.apply(@, [options]) _.extend(BaseView.prototype, Backbone.View.prototype, { #etc. tec. BaseView.extend = Backbone.View...
dagda1
1

votes
0

answer
10

views

how to add animation to a zoom effect that uses the svg matrix function

I am using the matrix function in the snipped below to add zooming. In the real application, there is zooming, panning and skewing and I like being able to do this from the uniform interface of the affine matrix rather than individual translate, rotate, skew and scale functions. e.g. currentZoom +=...
dagda1
1

votes
2

answer
1.1k

views

vim “Unexpected 'INDENT'” coffeescript on every new line

I am quite new to vim and I am trying to edit coffeescript. Whenever I take try and add a new line, the coffeescript no longer compiles, I always get the following error: Error: Parse error on line 14: Unexpected 'INDENT' This happens every time I take a new line. If I edit the same file in textmate...
dagda1
1

votes
1

answer
764

views

Passing data between states in the Ember.js state manager

I have the following StateManager: Lead.StateManager = Ember.StateManager.extend initialState: 'notParsing' notParsing: Ember.State.create startParsing: (manager, search) -> manager.goToState 'parsing' parsing: Ember.State.create enter: -> I am able to transition from the notParsing state to the par...
dagda1
1

votes
1

answer
713

views

Get Ember-data model type from string

If I have a model type defined like this: App.Model = DS.Model.extend({}); How could I construct the type from a string like 'model'; I dwant to be to be generic about using the store, instead of having to be specific like this: App.store.load(App.model, obj);
dagda1
1

votes
2

answer
713

views

Ember.Binding.transform migration to latest code

Ember.Binding.transform has been removed or replaced in the latest ember. I have a number of bindings that take this form: valueBinding: Ember.Binding.transform({ to: function(value, binding) { //return something }, from: function(value, binding) { //return something } }).from('parentView.content.f...
dagda1
1

votes
1

answer
435

views

Regex to exclude file pattern

I have the following regex which I want to ignore sass partials: At the moment it looks like this: match /app\/stylesheets\/(?:.+\/)?[^_].+\.s[ca]ss/ do sass end Example file paths I want to parse are: /app/stylesheets/nonpartial.scss /app/stylesheets/folder/anothernonpartial.scss And examples of th...
dagda1
1

votes
1

answer
176

views

Ember.js connectOutlets runs on root the moment Router is created

I have the following ember router definition: WZ.Router = Em.Router.extend enableLogging: true location: 'hash' showHome: Ember.Route.transitionTo 'root.index' root: Em.Route.extend initialState: 'index' connectOutlets: (router, event) -> unless router.get 'initialized' router.get('applicationContro...
dagda1
1

votes
3

answer
64

views

how can I get the name of each argument in the arguments object in javascript

In javascript we have the arguments object that is a not quite array that we can query. How can I get the name of each argument? For example if I want to know that the 3rd argument is called embedded for example, how would I discover this? arguments[2].name == 'embedded' Obviously the above does not...
dagda1
1

votes
1

answer
201

views

Ember-data - Retrieve all types that extend DS.Model

Is there a way of tell if a type extends DS.Model? For example, I might have a class like this: App.Klass = DS.Model.extend() I want to say something like: Ember.A(Ember.keys(Radium)).forEach (a) -> createType(a) instanceof DS.Model The above will always be false because they are not instances. Can...
dagda1
1

votes
1

answer
311

views

ember-data: tell if a computed property is readonly

Can I tell if a computed property is readonly? I want to avoid trying to set a property that is readonly and this code being triggered: if (this._readOnly) { throw new Error('Cannot Set: ' + keyName + ' on: ' + obj.toString() ); }
dagda1
1

votes
2

answer
933

views

Sidekiq on heroku - Error R14 (Memory quota exceeded)

I have a sidekiq process which runs on heroku that blows up after it has been running for a while with this error message: Error R14 (Memory quota exceeded) Can anyone give me any pointers about how to start the diagnosis as to what is happening? There is nothing obvious that could be causing this.
dagda1
1

votes
1

answer
306

views

elasticsearch in a single page application

I am looking for some high level advice on the following: I want to use elasticsearch in an ember.js single page application. I have a sinatra application which is the API layer for this application. What would be the best way of utilising elasticsearch? Should I create a proxy layer in the sinatra...
dagda1

View additional