Skip to content

Instantly share code, notes, and snippets.

View arnaudbreton's full-sized avatar

Arnaud Breton arnaudbreton

View GitHub Profile
@arnaudbreton
arnaudbreton / managemany.sh
Last active August 29, 2015 14:25 — forked from swooop/managemany.sh
Managing and uploading many contacts
curl -X POST \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/contact/managemanycontacts \
-H "Content-Type: application/json" \
'{
"ContactsLists": [
{
"ListID": 1,
"Action": "addnoforce"
},
@arnaudbreton
arnaudbreton / managecontactslists.sh
Last active August 29, 2015 14:25 — forked from swooop/managecontactslists.sh
Manage a contact list subscription
curl -X POST \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/contact/$ID/managecontactslists \
-H "Content-Type: application/json" \
-d '{
"ContactsLists":[
{
"ListID”: list_id,
"Action": "addnoforce"
},
@arnaudbreton
arnaudbreton / mention-twitter.js
Created May 30, 2014 09:22
Mention tweet feed
/*
*---------------------------------------------------------------
* Twitter
*---------------------------------------------------------------
*/
(function($, undefined){
"use strict";
var MentionApp = MentionApp || {};
@arnaudbreton
arnaudbreton / hello_mention.php
Created May 28, 2014 08:14
Talk with the mention's API
<?php
$url = "https://api.mention.com/api/accounts";
$postValues = array( "name" => "Mon nom trop bien", "email" => "test@test.fr", "password" => "motdepasse@de.fr", "language_code" => "fr", "client" => "feedsens");
$curlHandle = curl_init();
curl_setopt($curlHandle, CURLOPT_URL, $url);
curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curlHandle, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Accept: application/json'));
curl_setopt($curlHandle, CURLOPT_POST, true);
curl_setopt($curlHandle, CURLOPT_POSTFIELDS, json_encode($postValues));
@arnaudbreton
arnaudbreton / Gruntfile.coffee
Created April 18, 2014 15:24
PHP Unit with Grunt
terminal = require('color-terminal')
log = (error, stdout, stderr, cb) ->
if error
terminal.color('red').write stdout
else
terminal.color('green').write stdout
cb()
@arnaudbreton
arnaudbreton / async-process-jasmine.Spec.js
Last active August 29, 2015 14:00
The 5 best front-end developer tools blogpost: testing with Mocha and Jasmine
AsyncProcess = require('./async-process').AsyncProcess
describe('AsyncProcess', function() {
var asyncProcess;
beforeEach(function() {
asyncProcess = new AsyncProcess();
});
it('should process 42', function() {
@arnaudbreton
arnaudbreton / rsync-auto grunt alternative.coffee
Last active March 25, 2020 04:45
Gruntfile to trigger new Vagrant 1.5 rsync command when catching changes. Faster than Vagrant rsync-auto bundled command, mainly because Grunt only watches specified paths while Guard/Listen (used internally by Vagrant) watches the whole (sub)-folders.
terminal = require('color-terminal')
log = (error, stdout, stderr, cb) ->
if error
terminal.color('red').write stdout
else
terminal.color('green').write stdout
cb()
@arnaudbreton
arnaudbreton / Global.java
Last active August 29, 2015 13:56
Java and destructor
public class Global {
public static Temporary[] a;
public static void main(String [] args) throws Throwable
{
new Temporary().finalize();
System.out.println(Global.a[0].toString());
}
}
@arnaudbreton
arnaudbreton / spec.js
Created November 21, 2013 15:37
Sinon.js + Backbone : jQuery deferred are never trigerred
TestModel = Backbone.Model.extend({
url: '/test'
});
describe ('Model', function () {
it('should be able to change password (fake server)', function() {
var model, promise, request, server;
server = sinon.fakeServer.create();
@arnaudbreton
arnaudbreton / switch-evernote-production.sh
Last active December 26, 2015 02:39
Switch Evernote production <=> sandbox
# Switch to production
defaults delete com.evernote.Evernote
defaults write com.evernote.Evernote noteStoreURL https://www.evernote.com/edam/note
defaults write com.evernote.Evernote userStoreURL https://www.evernote.com/edam/user