This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pub fn handler(&self, req: CoAPRequest) -> Option<CoAPResponse> { | |
| match req.get_option(CoAPOption::UriPath) { | |
| Some(req_path) => { | |
| match req.get_class() { | |
| MessageClass::RequestType(rq_type) => { | |
| match self.map.get(&rq_type) { | |
| Some(dispatch) => { | |
| dispatch.get(&req_path) | |
| }, | |
| None => None, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # COMPARE TWO REFERENCES (Branch, Tag, Commit), both in Read-Only Mode | |
| # Use (from the git repo root): | |
| # <path to script>/diffref.sh master 123abcd | |
| # Build destination folder | |
| DATEHASH=`echo "obase=16; $(date +%s)" | bc` | |
| DESTFOLDER1=/tmp/diffref-$DATEHASH-$1 | |
| DESTFOLDER2=/tmp/diffref-$DATEHASH-$2 | |
| mkdir $DESTFOLDER1 | |
| mkdir $DESTFOLDER2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # COMPARE A REFERENCE AGAINST WORKING DIRECTORY | |
| # Use (from the git repo root): | |
| # <path to script>/diffref.sh master | |
| # Build destination temp folder | |
| DATEHASH=`echo "obase=16; $(date +%s)" | bc` | |
| DESTFOLDER=/tmp/diffref-$DATEHASH-$1 | |
| mkdir $DESTFOLDER | |
| # Export Reference |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import bcrypt as bc | |
| import simplecrypt as sc | |
| # Assume a SQL database, with two tables: | |
| # "User" - contains username, password hash, website settings | |
| # "Data" - contains data related to all users. Not sensitive (CC#'s, SSN#'s, Addresses), | |
| # but some kind of metric data users may not want publicly associated with them | |
| # such as bookmarks, favorite foods, shoe size, etc. | |
| # | |
| # Instead of encrypting ALL user data, which would be slow and defeat the purpose of |
NewerOlder