Skip to content

Instantly share code, notes, and snippets.

var glou = require('glou');
var gulpIf = require('gulp-if'),
gulpInsert = require('gulp-insert'),
gulpSourcemaps = require('gulp-sourcemaps'),
gulpWrapCommonjs = require('gulp-wrap-commonjs'),
gulpNgAnnotate = require('gulp-ng-annotate'),
gulpUglify = require('gulp-uglify'),
gulpConcat = require('gulp-concat');
Voici le fameux test. Le but du jeu est de trouver le plus petit nombre qui vérifie:
- Si la propriété X est vérifié, alors le chiffre X fait partie du nombre
- Sinon, le chiffre ne fait pas partie du nombre.
0. un des chiffre somme des autres
1. chiffres suite décroissante
2. au moins 2 chiffres impairs
// Assign conversation to teammate identified by username
{type: 'assign', teammate: 'andre'}
// Unassign conversation
{type: 'unassign'}
// Toggle archive / open
{type: 'toggle_archived'}
// Toggle move to trash / undelete
var $front = $('#front')[0].contentWindow;
$('button.assign-self').click(function () {
$front.postMessage({type: 'assign', assignee: 'laurent'}, 'https://app.frontapp.com');
});
$('button.auto-reply').click(function () {
$front.postMessage({
type: 'reply',
body: 'All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy. All work and no play makes Jack a dull boy.'
window.addEventListener('message', function (e) {
$('.contact-info span').text(e.data.contact.handle);
$('.message-info span').text(e.data.message.blurb);
});
html, * {
box-sizing: border-box;
font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, Arial;
}
.plugin {
float: right;
width: 300px;
height: 700px;
background: #4a4a4a;
<div class="plugin">
<h1>Demo Extension</h1>
<button class="assign-self">Take lead</button>
<button class="auto-reply">Auto Reply</button>
<div class="contact-info">
<h2>Contact Info</h2>
<span></span>
</div>
@lperrin
lperrin / plugin_api.js
Created December 17, 2014 15:44
Plugin API
var _ = require('underscore');
module.exports = function (ngModule) {
ngModule.service('pluginapi', function ($window, $rootScope, team, conversationsSelection, singleConversation) {
this.publish = function () {
var allowedDomain = $window.__allowEmbed;
if (!allowedDomain)
return;
@lperrin
lperrin / front_contact_api.md
Last active August 29, 2015 14:06
Front Contact API

The Front Contact API makes it possible to programmatically create of update contacts of your company. To use it, you need a login/password that you can retrieve by contacting us at team@frontapp.com.

The API is located at https://api.frontapp.com/api/1/contacts and uses a BASIC auth.

At the moment, it only accepts JSON POST requests:

{
  "name": "Bruce Wayne",
 "description": "CEO / Wayne.inc",
frontApp.service('desktop', function () {
this.sendDesktopNotification = $log.wrapException(function (notification) {
$window.osx.sendNotification_message_link_(notification.title, notification.description, notification.link);
});
});
// somewhere else in the app:
desktop.sendNotification(notification);