Skip to content

Instantly share code, notes, and snippets.

View padhyakash's full-sized avatar

Akash Padhy padhyakash

  • Johnson Controls
  • Bangalore
View GitHub Profile
@padhyakash
padhyakash / gist:0791425a0656b02b52d5d6678f220118
Last active September 5, 2018 12:58
Calculate Total hours for an invoice period
hourSetting.getTime()
.then(function (res) {
if (res.status === 200) {
$scope.time = res.data;
$scope.shortDate = $filter('orderBy')(res.data, 'timestamp');
$scope.min = $scope.shortDate[0].timestamp;
$scope.max = $scope.shortDate[$scope.shortDate.length - 1].timestamp;
console.log($scope.max);
hourSetting.get_cusSetting()
.then(function (res) {
@padhyakash
padhyakash / gist:29322526f3ca9b801b077ba9f53d25f8
Created July 27, 2018 07:52
while loading the data the error message is showing for 2 sec
$scope.serverIsLoading = true;
serverSetting.getServers()
.then(function (response) {
$scope.servers = [];
if (!response.data.error && !response.data.null) {
angular.forEach(response.data, function (server) {
serverSetting
.getConfig(server.certname)
.then(function (response) {
$scope.serverIsLoading = true;
serverSetting.getServers()
.then(function (response) {
// console.log(response);
$scope.servers = [];
// var regex = /^[a-z]+\.[a-z]{5,8}$/;
if (!response.data.error && !response.data.null) {
angular.forEach(response.data, function (server) {
var a;
var b;
var c = ( a * (Math.pow(b, 0.85))); if answer is 4.89
4.89 = 4 hours and 0.89 * 0.6 == 53.4 == 53 minutes I want it to say: 4h53m (for 4.89)
here the var c will return 4h53m
HTML:
<div id="content">
<div class="topcontent3">
<div class="ad-container">
<md-card aria-label="Obmondo" class="login-card">
<form name="createUser" ng-submit="ctrl.createUser(user)" novalidate>
<md-card-header class="color2">
<md-card-header-text>
<span class="md-title">Create User</span>
Service:
function chngPwd(password, token) {
return $http.put(BASE_URL + 'user/password/reset/{token}', {password: password, token: token});
}
controller:
this.check_pass = function (change) {
if (change.password !== change.confirmPassword) {
toastr.error('Passwords do not match', 'Error');
return;
gitlab-ci.yml file looks like:
image: runejuhl/nodejs-build:latest
stages:
- test
- build
test:
stage: test
script: