Skip to content

Instantly share code, notes, and snippets.

View cbonnissent's full-sized avatar

Charles Bonnissent cbonnissent

View GitHub Profile
let syncReturnPromise = null;
let resolveReturn = null;
let actionSave = [];
syncReturn(Vue, $store, apiResponse, action = false) => {
if(action){
actionSave.push(action);
}
if (syncReturnPromise !== null) {
resolveReturn(Vue, $store, apiResponse);
@cbonnissent
cbonnissent / dashboard.yaml
Last active April 27, 2018 12:38
test.json
dashboard "Food":
- h1 text: Food
- h2 text: By caloric content
- 3 columns:
- rows:
- h3 text: Bananas
- pie chart: {
"columns": [
["Protein", 5], ["Sugar", 10], ["Other carbs", 40], ["Fat", 1]
]
(function umdRequire(root, factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define([ < dependances > ], factory);
} else {
factory( < dependances > );
}
}(window, function widget(
define([ < dependances > ], function init() {
$.widget("<nom_du_module>", < module_parent > , function widget() {...
});
(function amdRequire(root, factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define([
'jquery',
'underscore',
'mustache',
'deps1',
'deps2'
@cbonnissent
cbonnissent / app.js
Last active December 19, 2015 03:29
Some fun with d3.js
(function() {
var width = 960,
height = 500,
outer = d3.select("#graph")
.append("svg:svg")
.attr("width", width)
.attr("height", height)
.attr("pointer-events", "all");
})();
@cbonnissent
cbonnissent / Default (Linux).sublime-keymap.json
Created April 18, 2013 12:14
my sublime text key binding.json
[
{
"keys": ["alt+shift+&"],
"command": "set_layout",
"args":
{
"cols": [0.0, 1.0],
"rows": [0.0, 1.0],
"cells": [[0, 0, 1, 1]]
}
<?php
class JsonHandler
{
protected static $_messages = array(
JSON_ERROR_NONE => 'No error has occurred',
JSON_ERROR_DEPTH => 'The maximum stack depth has been exceeded',
JSON_ERROR_STATE_MISMATCH => 'Invalid or malformed JSON',
JSON_ERROR_CTRL_CHAR => 'Control character error, possibly incorrectly encoded',
JSON_ERROR_SYNTAX => 'Syntax error',
@cbonnissent
cbonnissent / macro_ooo
Last active December 15, 2015 04:58
Macro OOO for DcP family
REM ***** BASIC *****
sub color()
dim F as object
dim i as integer, j as integer, nbLig as integer, Lig as integer
dim Color as long , FColor as long
dim Fin as boolean,Empty as integer
dim EndLigne as integer
EndLigne = 255
@cbonnissent
cbonnissent / documentControllerevent.js
Last active August 29, 2015 14:13
documentController event
$.ready(function() {
var myDocumentCheck = function(document) { return document.family.name === "ANIMAL" && document.view.id === "view1"};
//Ajouter un event au ready
window.dcp.document.documentController("addEvent", "ready", {
"documentCheck" : myDocumentCheck,
"name" : "myEvent.animal"
}, function(document) {