Skip to content

Instantly share code, notes, and snippets.

@Furzel
Furzel / hipchat.js
Created November 21, 2013 22:45
Quick message sender for hipchat API. There is two way to send a message : either create a new sender with new Sender() and call mySender.send() to fire messages or use sendMessage if you need to send only one message with this configuration.
var hipchat = require('hipchat-js')("*** API TOKEN HERE ****");
exports.Sender = function(roomId, senderName, messageFormat, notify) {
this.roomId = roomId;
this.senderName = senderName;
this.notify = notify;
this.messageFormat = messageFormat;
this.send = function(message, color) {
if (!color)
#!/bin/bash
libudev='libudev.so.0'
binary=`./MyApp`
# remove old symlink if exist
if [ -a $libudev ]
then
rm $libudev
fi
# check wether libudev.so.0 can be found on the system
@Furzel
Furzel / customAssert.js
Created July 13, 2014 21:22
How to add a custom assertion to should.js
var should = require('should');
should.use(function (should, Assertion) {
Assertion.add('myEql', function (value, description) {
this.params = { operator: 'to be' + should.format(expectedTraces), message: description};
this.assert(value === this.obj);
});
});
@Furzel
Furzel / front_contact_api.js
Created September 25, 2014 01:26
Basic Front contact API example
var https = require('https');
var apiKey = '*** YOUR API KEY ***',
companySlug = '*** YOUR COMPANY SLUG ***';
var data = {
name: 'Arthur Dent',
description: 'Earthman',
fields: [
{
@Furzel
Furzel / api_contact_json.json
Created September 25, 2014 01:41
Contact route expected JSON
{
"name": "String - your contact full name",
"description": "Optional String - describe your contact",
"fields": [
{
"source": "String - either email, twitter or phone",
"handle": "String - email address, phone number, twitter handle as selected by the above source field"
}
],
"links": [
@Furzel
Furzel / list_inboxes_response.json
Last active August 29, 2015 14:07
list inboxes response format
[
{
"alias": "support",
"name": "Support",
"type": "imap",
"address": "support@mycompany.com",
"links": {
"messages": "webhooks.frontapp.com/api/1/inboxes/support/messages",
"inbox": "webhooks.frontapp.com/api/1/inboxes/support"
}
@Furzel
Furzel / email_post_format.json
Created September 30, 2014 10:32
Send Email to Front's public API
{
"from": "sender@provider.com",
"subject": "Email's subject",
"text_body": "Your email content in a text format",
"html_body": "Your email <b>content</b> in an <i>HTML</i> format"
}
@Furzel
Furzel / public_sms_format.json
Created September 30, 2014 11:13
Front sms format for public api
{
"from": "+123456789",
"body": "Your sms content"
}
@Furzel
Furzel / post_email_public_api.js
Created September 30, 2014 12:54
Post an email to Front public API
var https = require('https'),
url = require('url');
// your credentials
var apiKey = '*** YOUR API KEY ***',
companySlug = '*** YOUR COMPANY SLUG ***';
// Build the first request to retrieve all your inboxes
var listInboxesOptions = {
host: 'webhooks.frontapp.com',
@Furzel
Furzel / build_nw.bat
Created October 16, 2014 13:45
Auto build nw application on nw with custom icon
@echo off
REM %1 is either staging or prod
REM Copy the config files and resources
copy %1\package.json .
copy %1\config.json .
copy ..\res\img\favicon.png .
copy ..\res\img\logo.png .