Skip to content

Instantly share code, notes, and snippets.

View adadgio's full-sized avatar

Romain Bruckert adadgio

View GitHub Profile
@adadgio
adadgio / phantom-casperjs-install.sh
Last active November 9, 2015 11:37 — forked from mickaelandrieu/install.sh
Install phantomjs/casperjs on GNU/Linux
#!/bin/bash
# `` sudo sh install.sh ``
# Developement environnement
# Important: use 'i686' instead of 'x86_64'
#
# For stable environnement see also : https://gist.github.com/mickaelandrieu/6312724
echo Installation de Phantomjs
cd /usr/local/share
sudo wget https://phantomjs.googlecode.com/files/phantomjs-1.9.2-linux-x86_64.tar.bz2
Require JS controller
/**
* @namespace \bundles\UploadBundle\Controller
*/
define(['bundles/UploadBundle/Component/Upload'], function (Upload) {
'use strict';
return {
/**
/**
* @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)
<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>
// 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;
/**
* 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;
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
// 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)
{
//ProjectListFilter
interface Range {
from: number;
to: number;
}
type UiFilterObject = {
id: string
label: string
{
"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",