Skip to content

Instantly share code, notes, and snippets.

@TrevorPage
TrevorPage / gist:eeed5022e03978d9d003898ffe00f7db
Last active April 4, 2018 17:00
loopback-component-storage example
// ------------------------------------------------------------------------
// Disable the built-in methods for create and update.
Dashasset.disableRemoteMethodByName('replaceOrCreate'); // Disable the standard PUT / endpoint
Dashasset.disableRemoteMethodByName('replaceById'); // Disable the standard PUT /{id} endpoint, I think
Dashasset.disableRemoteMethodByName('create'); // Disable the standard POST endpoint
/**
* Defines the endpoint at /{id} using PUT for create or update (upsert) of dashboard assets.
@TrevorPage
TrevorPage / my-model.js
Last active March 26, 2017 09:19
Forced bulk update / rebase endpoint for StrongLoop LoopBack Synchronization, avoiding conflict resolution
// ------------------------------------------------------------------------
Dashcomponent.bulkUpdateForced = function(updates, cb) {
console.log("bulkUpdateForced");
console.log(updates, null, 2);
@TrevorPage
TrevorPage / SizedFileInputStream
Created April 12, 2015 12:29
SizedFileInputStream
// Your package here
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import com.dropbox.sync.android.DbxException;
import com.dropbox.sync.android.DbxFile;