Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
import { observer } from '@ember/object';
export default Ember.Component.extend({
obsCallCount: 0,
prop1: null,
prop2: null,
prop1Observer: observer('prop1', function () {
class RtsModbusSerialClient(ModbusSerialClient):
def _send(self, request):
''' Sends data on the underlying socket
:param request: The encoded request to send
:return: The number of bytes written
'''
if not self.socket:
raise ConnectionException(self.__str__())
@cristi-badila
cristi-badila / DateTimeExtensionMethods.cs
Last active July 24, 2020 16:42
Month diff calculator
public static class DateTimeExtensionMethods
{
public static int GetMonthsDiff(this DateTime fromDate, DateTime toDate)
{
if (fromDate > toDate)
{
var aux = fromDate;
fromDate = toDate;
toDate = aux;
}