how to get the last character of a string?
An elegant and short alternative, is the String.prototype.slice method. Just by: A negative start index slices the string from length+index, to length, being index -1, the last character is extracted:
An elegant and short alternative, is the String.prototype.slice method. Just by: A negative start index slices the string from length+index, to length, being index -1, the last character is extracted:
Excel export script works on IE7+, Firefox and Chrome. Just create a blank iframe: Call this function on:
Edit: Several years have passed and this isn’t really the right way to do this any more (and probably never was, my bad). Mutating an imported module is nasty and can lead to side effects like tests that pass or fail depending on execution order. I’m leaving this answer in its original form for historical … Read more
The reason why there is no ngEnabled directive in Angular is rather semantical – there is simply nothing corresponding to it in HTML specification. At the same time there is already ngDisabled directive that works with disabled attribute. For the same reason, there is no ngUnchecked directive, because there is already ngChecked that sets/removes checked attribute. Now, the reasonable question: why we have both ngShow and ngHide then? Well it’s just … Read more
Running this command was my mistake. npm config set prefix /usr/local Path /usr/local is not for windows. This command changed the prefix variable at ‘C:\Program Files (x86)\Git\local’ To access and make a change to this directory I need to run my cmd as administrator. So I did: Run cmd as administrator Run npm config edit (You will get notepad editor) … Read more
The change event is triggered on the <select> element, not the <option> element. However, that’s not the only problem. The way you defined the change function won’t cause a rerender of the component. It seems like you might not have fully grasped the concept of React yet, so maybe “Thinking in React” helps. You have to store the selected value as state and … Read more
Minimum eight characters, at least one letter and one number: Minimum eight characters, at least one letter, one number and one special character: Minimum eight characters, at least one uppercase letter, one lowercase letter and one number: Minimum eight characters, at least one uppercase letter, one lowercase letter, one number and one special character: Minimum … Read more
Basically when using mongoose, documents can be retrieved using helpers. Every model method that accepts query conditions can be executed by means of a callback or the exec method. callback: exec: Therefore when you don’t pass a callback you can build a query and eventually execute it. You can find additional info in the mongoose docs. UPDATE Something to note … Read more
Check to see if the Remote Procedure Call (RPC) service is running. If it is, then it’s a firewall issue between your workstation and the server. You can test it by temporary disabling the firewall and retrying the command. Edit after comment: Ok, it’s a firewall issue. You’ll have to either limit the ports WMI/RPC work on, … Read more
Often, in event handlers, such as onsubmit, returning false is a way to tell the event to not actually fire. So, say, in the onsubmit case, this would mean that the form is not submitted.