Skip to content

Instantly share code, notes, and snippets.

View almet's full-sized avatar
🗺️

Alexis Métaireau almet

🗺️
View GitHub Profile
diff --git a/test/components/EditableField_test.js b/test/components/EditableField_test.js
index a601f3d..15aad4c 100644
--- a/test/components/EditableField_test.js
+++ b/test/components/EditableField_test.js
@@ -4,7 +4,7 @@ import { expect } from "chai";
import sinon from "sinon";
import { Simulate } from "react-addons-test-utils";
-import { createComponent } from "../test-utils";
+import { createComponent, d } from "../test-utils";
@almet
almet / kinto.ini
Created March 22, 2016 14:01
Kinto bundled apps
kinto.includes = kinto.plugins.default_bucket kinto_attachment
kinto.attachment.base_url = http://localhost:8000
kinto.attachment.folder = files/{bucket_id}/{collection_id}/
kinto.attachment.keep_old_files = false
kinto.attachment.base_path = /tmp
[global]
trackers =
udp://localhost:6969
[global]
trackers = udp://localhost:6969
@almet
almet / kinto-signature-validation-firefox.js
Created March 10, 2016 13:30
Kinto signature validation in Firefox chrome.
Cu.import("resource://services-common/canonical-json.js");
function mergeChanges(localRecords, changes) {
const records = {};
localRecords.data.forEach(function(record) {
records[record.id] = record;
});
// Apply remote changes in the "records" variable.
// All records that exists already are replaced by the version from the
// server.
@almet
almet / firefox-javascript-hacking.md
Last active February 25, 2016 14:21
How to do some JavaScript coding for Firefox
diff --git a/docs/overview.rst b/docs/overview.rst
index 03c75eb..e43fb3a 100644
--- a/docs/overview.rst
+++ b/docs/overview.rst
@@ -183,25 +183,25 @@ What follows is a comparison table showing how Kinto stacks up compared to some
other projects in this space.
-=========================== ====== ====== ======== ======= ======= ============== ======= ========= ================
-Project Kinto Parse Firebase CouchDB Kuzzle Remote-Storage Hoodie BrowserFS Couchbase Mobile
function main() {
const headers = {Authorization: "Basic " + btoa("user:pass")};
/**
* Convert an Array Buffer into a base64 String.
*
* @param {ArrayBuffer} buffer - The Array buffer to convert.
* @returns {String} - The base64 representation of the given Array
* Buffer.
@almet
almet / -.diff
Last active January 18, 2016 13:57
diff --git a/calendar.js b/calendar.js
index ce462d6..faca709 100644
--- a/calendar.js
+++ b/calendar.js
@@ -10,17 +10,29 @@ $(document).ready(function() {
// Local store in IndexedDB.
var store;
-
var headers;
@almet
almet / test.js
Created January 7, 2016 10:39
Kinto.js get an element.
var db = new Kinto({remote: "https://kinto.dev.mozaws.net/v1/", bucket:"central-repository", headers: {Authorization: "Basic " + btoa("user:pass")}});
var collection = db.collection("server_locations");
collection.get("user_id").then(function(resp) {
// Do something with your "resp" here.
});