$ dropbox -h
commands:
Note: use dropbox help <command>
to view usage for a specific command.
status
get current status of the dropboxdthrottle
set bandwidth limits for Dropboxhelp
provide helppuburl
get public url of a file in your dropbox's public folderstop
stop dropboxdrunning
return whether dropbox is runningstart
start dropboxdfilestatus
get current sync status of one or more filesls
list directory contents with current sync statusautostart
automatically start dropbox at loginexclude
ignores/excludes a directory from syncinglansync
enables or disables LAN syncsharelink
get a shared link for a file in your dropboxproxy
set proxy settings for DropboxIn short use: dropbox exclude [file or folder name]
Pure code example:
/**
* OBSERVER PATTERN:
*
* This pattern implements the Subject and Observer objects.
* Most of the hard work is done by the Subject, the Observer
* needs to have a way to receive the updated value. Usually
* only by implementing the update() method.
*/
class Subject {
constructor() {
/**
* The list of threads observed based on each user's instance.
* this will contain a list of observers.
*/
this.observers = [];
}
isSubscribed(o) {
/* Help us check if the observer for an user is already subscribed */
return this.observers.filter(subscriber => subscriber === o).length;
}
subscribe(o) {
/* Verifies that the user is not subscribed already */
if (this.isSubscribed(o)) return;
/* If the user is not subscribed adds the function to the list */
this.observers.push(o);
}
unsubscribe(o) {
/**
* returns a new array of functions without the one passed as argument,
* Basically unsubscribing the user from that thread.
*/
this.observers = this.observers.filter(subscriber => subscriber !== o);
}
notify(data) {
/**
* notifies the user, it passes the data to each observer
* set in the list so that it's updated.
*/
this.observers.forEach(observer => observer.update(data));
}
}
// ------------------------------------------------------------------
// :: Example Usage
// ------------------------------------------------------------------
class Temperature extends Subject {
constructor(tmp = 0) {
super();
this.tmp = tmp;
}
setTmp(tmp) {
if (this.tmp !== tmp) {
this.notify(tmp);
}
this.tmp = tmp;
}
}
class SensorObserver {
/**
* Required method used in the subject to update the observable value.
*/
update(data) {
console.log('Observable value has changed:[%j]', data);
}
}
let tmp = new Temperature(22);
let sen = new SensorObserver();
tmp.subscribe(sen);
// simulate temperature changes
setInterval((min, max) => {
tmp.setTmp(Math.floor(Math.random() * (max - min) ) + min);
}, 2000, 18, 24);
Binary search is the most efficient searching algorithm having a run-time complexity of O(log2 N)
. This algorithm works only on a sorted list of elements.
Binary search begins by comparing the middle element of the list with the target element. If the target value matches the middle element, its position in the list is returned. If it does not match, the list is divided into two halves. The first half consists of the first element to middle element whereas the second half consists of the element next to the middle element to the last element.
Course link
ssh -D 8123 -f -C -q -N sammy@example.com
-D
: Tells SSH that we want a SOCKS tunnel on the specified port number (you can choose a number between 1025-65536)-f
: Forks the process to the background-C
: Compresses the data before sending it-q
: Uses quiet mode-N
: Tells SSH that no command will be sent once the tunnel is up