Skip to content

Instantly share code, notes, and snippets.

View adadgio's full-sized avatar

Romain Bruckert adadgio

View GitHub Profile
<?php
namespace Medical\CoreBundle\Component\Tool;
class CreatinineCalculator
{
const MDRD = 'MDRD';
const COCKROFT = 'COCKROFT';
/**
import ROOT_DIR from '../../rootdir'
require('dotenv').config({ path: `${ROOT_DIR}/.env` })
import axios, { AxiosResponse } from 'axios'
import { Notification, ios, android, openInPayload } from './notifications'
type NamedUser = {
named_user_id: string
attributes: any
channels: any[]
}
{
"result": [
{
"objectId": "oArt1234x",
"createdAt": "2015-12-01T01:01:01.000Z",
"updatedAt": "2021-10-29T09:39:47.000Z",
"__type": "Object",
"className": "Article",
"m_id": 1234,
"m_label": "test video live",
//ProjectListFilter
interface Range {
from: number;
to: number;
}
type UiFilterObject = {
id: string
label: string
// In some script
if (!has(['username', 'password'], req.body) {
// console.log('Request body: <username> and <password> are required')
}
// Function in file: has.ts
export const NOT_EMPTY = true
export function has(thoseKeys: Array<string>, object: any, cantBeEmpty: boolean = false)
{
import { ADVERT_TYPES } from "./Advert"
//export const CAMPAIGN_ACTIONS = [...ADVERT_TYPES, ['shortlink', 'notification']]
export class Project {
id: string | null = null
name: string | null = null
keyAccount: string | null = null
status: string | null = "1"
clientName: string | null = null
/**
* Convert any input data to bits representation.
*/
export type RowInput = {
[prop: string]: string|number|Array<string|number>|boolean;
};
export function isArray(input: any)
{
return ( Object.prototype.toString.call(input) === '[object Array]' ) ? true : false;
// if not on symfony, adapt... but logic is here !
<?php
namespace Medical\CoreBundle\Controller;
use Symfony\Component\Finder\Finder;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
<div class="upload-widget" id="upload-widget">
<div class="upload-widget-header">Upload item(s)</div>
<div class="upload-widget-items">
<ul id="upload-widget-list" data-prototype="{% filter escape %}
{{ include('MedicalCoreBundle:Upload:upload_item_prototype.html.twig', { truc: null }) }}
{% endfilter %}">
</ul>
</div>
</div>
/**
* @namespace \bundles\UploadBundle\Component
*/
define(['resumable'], function (Resumable) {
'use strict';
var r = null,
button = null,
uploadedFiles = [],
widget = 'ul#upload-widget-list'; // to show each file progress bar in ul > li(s)