Skip to content

Instantly share code, notes, and snippets.

View iaditya's full-sized avatar
🐢
Learning

Aditya Pansari iaditya

🐢
Learning
View GitHub Profile
[HttpGet("UserSalary/{userId}")]
public IEnumerable<UserSalary> GetUserSalary(int userId)
{
return _ef.UserSalary.Where((u) => u.UserId == userId).ToList<UserSalary>();
}
//With dapper, it works
[HttpGet("UserSalary/{userId}")]
public IEnumerable<UserSalary> GetUserSalary(int userId)
[
{
name: 'Afghanistan',
alpha2Code: 'AF',
alpha3Code: 'AFG',
callingCodes: [ '93' ],
flag: 'https://restcountries.com/data/afg.svg'
},
{
name: 'Albania',
function main(input) {
let arr = [], g;
input.split("\n").forEach(function(item) {
arr.push(item.split(" ").map(i => parseInt(i)));
});
arr[2].sort(function(a, b) {
return a - b;
});
@iaditya
iaditya / throttle-debounce
Created June 4, 2019 08:17 — forked from xincici/throttle-debounce
throttle and debounce functions extracted from underscore.js
(function(){
var _ = {};
_.now = Date.now || function(){
return new Date().getTime();
};
// Returns a function, that, when invoked, will only be triggered at most once
// during a given window of time. Normally, the throttled function will run
// as much as it can, without ever going more than once per `wait` duration;
@iaditya
iaditya / jsCSVFileCreationBlob.js
Created July 11, 2018 09:56 — forked from dhunmoon/jsCSVFileCreationBlob.js
JS: CSV File Creation Using BLOB
function exportToCsv(filename, rows) {
var processRow = function (row) {
var finalVal = '';
for (var j = 0; j < row.length; j++) {
var innerValue = row[j] === null ? '' : row[j].toString();
if (row[j] instanceof Date) {
innerValue = row[j].toLocaleString();
};
var result = innerValue.replace(/"/g, '""');
if (result.search(/("|,|\n)/g) >= 0)
directive('btnLoading',function () {
return {
link:function (scope, element, attrs) {
scope.$watch(
function () {
return scope.$eval(attrs.btnLoading);
},
function (value) {
if(value) {
if (!attrs.hasOwnProperty('ngDisabled')) {
#include <cstdio>
#include <iostream>
#define MAX 10
using namespace std;
//function prototype
void sortBubble(int arr[], int n);
void swap(int *a, int *b);
public function getAvailableSlotOnDay($provider_id, $facility_id, $sdate, $slot_type)
{
$data = array();
if ($sdate == null) {
$sdate = Date::now()->toDateString();
}
// current time
$current_time = Time::now()->toDateTimeString();
Log::debug("Current Time : {$current_time}");
public function getAvailableSlotByDay($provider_id, $facility_id, $sdate, $slot_type)
{
$data = array();
$day = $this->getDayIndex($sdate);
$date = new Date($sdate);
//$events_start = $date->toDateTimeString();
//$events_end = $date->addDays(1)->toDateTimeString();
// Patient cancel their tele-app
$notificationManager->addTemplate('cancelTeleAppointmentByPatient', [
'title' => 'Cancelled Tele Appointment',
'body' => 'Tele event has been cancelled.',
'smsbody' => 'Tele event has been cancelled.'
]);
// drugAlert
$notificationManager->addTemplate('drugAlert', [